diff options
-rw-r--r-- | sys/net/if_pppoe.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c index 540793bd6f6..eb08343200e 100644 --- a/sys/net/if_pppoe.c +++ b/sys/net/if_pppoe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppoe.c,v 1.72 2020/08/21 22:59:27 kn Exp $ */ +/* $OpenBSD: if_pppoe.c,v 1.73 2020/09/13 11:00:40 kn Exp $ */ /* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */ /* @@ -114,27 +114,33 @@ struct pppoetag { #define PPPOE_DISC_MAXPADI 4 /* retry PADI four times (quickly) */ #define PPPOE_DISC_MAXPADR 2 /* retry PADR twice */ +/* + * Locks used to protect struct members and global data + * I immutable after creation + * N net lock + */ + struct pppoe_softc { struct sppp sc_sppp; /* contains a struct ifnet as first element */ - LIST_ENTRY(pppoe_softc) sc_list; - unsigned int sc_eth_ifidx; - - int sc_state; /* discovery phase or session connected */ - struct ether_addr sc_dest; /* hardware address of concentrator */ - u_int16_t sc_session; /* PPPoE session id */ - - char *sc_service_name; /* if != NULL: requested name of service */ - char *sc_concentrator_name; /* if != NULL: requested concentrator id */ - u_int8_t *sc_ac_cookie; /* content of AC cookie we must echo back */ - size_t sc_ac_cookie_len; /* length of cookie data */ - u_int8_t *sc_relay_sid; /* content of relay SID we must echo back */ - size_t sc_relay_sid_len; /* length of relay SID data */ - u_int32_t sc_unique; /* our unique id */ - struct timeout sc_timeout; /* timeout while not in session state */ - int sc_padi_retried; /* number of PADI retries already done */ - int sc_padr_retried; /* number of PADR retries already done */ - - struct timeval sc_session_time; /* time the session was established */ + LIST_ENTRY(pppoe_softc) sc_list;/* [N] */ + unsigned int sc_eth_ifidx; /* [N] */ + + int sc_state; /* [N] discovery phase or session connected */ + struct ether_addr sc_dest; /* [N] hardware address of concentrator */ + u_int16_t sc_session; /* [N] PPPoE session id */ + + char *sc_service_name; /* [N] if != NULL: requested name of service */ + char *sc_concentrator_name; /* [N] if != NULL: requested concentrator id */ + u_int8_t *sc_ac_cookie; /* [N] content of AC cookie we must echo back */ + size_t sc_ac_cookie_len; /* [N] length of cookie data */ + u_int8_t *sc_relay_sid; /* [N] content of relay SID we must echo back */ + size_t sc_relay_sid_len; /* [N] length of relay SID data */ + u_int32_t sc_unique; /* [I] our unique id */ + struct timeout sc_timeout; /* [N] timeout while not in session state */ + int sc_padi_retried; /* [N] number of PADI retries already done */ + int sc_padr_retried; /* [N] number of PADR retries already done */ + + struct timeval sc_session_time; /* [N] time the session was established */ }; /* incoming traffic will be queued here */ |