diff options
author | brooks <brooks@FreeBSD.org> | 2004-09-01 18:22:14 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2004-09-01 18:22:14 +0000 |
commit | ba918da2a51c9e7f2352076e0fbab5f3a82f8104 (patch) | |
tree | 0fdc8d4c7e4a1a23a7a359dc70fbd001b86bbe22 /sys | |
parent | 7f91bb5d9aea96d133ac63690a8e5483654c4503 (diff) | |
download | FreeBSD-src-ba918da2a51c9e7f2352076e0fbab5f3a82f8104.zip FreeBSD-src-ba918da2a51c9e7f2352076e0fbab5f3a82f8104.tar.gz |
Use a spare byte in struct if_data to store the structure size without
increasing it. Add code to ifconfig to use this size to find the
sockaddr_dl after the struct if_data in the routing message. This
allows struct if_data to grow (up to 255 bytes) without breaking
ifconfig.
Submitted by: peter
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 1 | ||||
-rw-r--r-- | sys/net/if.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 0bb5389..ef48f1e 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -399,6 +399,7 @@ if_attach(struct ifnet *ifp) if_index = ifp->if_index; if (if_index >= if_indexlim) if_grow(); + ifp->if_data.ifi_datalen = sizeof(struct if_data); ifnet_byindex(ifp->if_index) = ifp; ifdev_byindex(ifp->if_index) = make_dev(&net_cdevsw, diff --git a/sys/net/if.h b/sys/net/if.h index 5a005c9..95389e6 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -85,6 +85,7 @@ struct if_data { u_char ifi_link_state; /* current link state */ u_char ifi_recvquota; /* polling quota for receive intrs */ u_char ifi_xmitquota; /* polling quota for xmit intrs */ + u_char ifi_datalen; /* length of this data struct */ u_long ifi_mtu; /* maximum transmission unit */ u_long ifi_metric; /* routing metric (external only) */ u_long ifi_baudrate; /* linespeed */ |