diff options
author | hrs <hrs@FreeBSD.org> | 2011-07-04 03:19:06 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2011-07-04 03:19:06 +0000 |
commit | c74259338a3a1c2e0c9a2f8831667786a5281518 (patch) | |
tree | 8bdd2c90bb7e90495334c07b73c8696a01093e8f /usr.sbin/rtadvd | |
parent | 5acd1abd93fcf6f4c05ad68a4ffddb284a4594fa (diff) | |
download | FreeBSD-src-c74259338a3a1c2e0c9a2f8831667786a5281518.zip FreeBSD-src-c74259338a3a1c2e0c9a2f8831667786a5281518.tar.gz |
Add sanity check for ifm_version in struct if_msghdr.
Diffstat (limited to 'usr.sbin/rtadvd')
-rw-r--r-- | usr.sbin/rtadvd/if.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c index 302c334..8722a05 100644 --- a/usr.sbin/rtadvd/if.c +++ b/usr.sbin/rtadvd/if.c @@ -105,6 +105,12 @@ if_nametosdl(char *name) lim = buf + len; for (next = buf; next < lim; next += ifm->ifm_msglen) { ifm = (struct if_msghdr *)next; + if (ifm->ifm_version != RTM_VERSION) { + syslog(LOG_ERR, + "<%s> RTM_VERSION mismatch (%d != %d).", + __func__, ifm->ifm_version, RTM_VERSION); + continue; + } if (ifm->ifm_type == RTM_IFINFO) { sa = (struct sockaddr *)(ifm + 1); get_rtaddrs(ifm->ifm_addrs, sa, rti_info); |