mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
- drop too short IPv6 frame
- NULL != 0 Obtained from: KAME MFC after: 3 weeks
This commit is contained in:
parent
21fb391fdb
commit
3bb61ca669
1 changed files with 15 additions and 10 deletions
|
|
@ -278,6 +278,10 @@ gif_encapcheck(m, off, proto, arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Bail on short packets */
|
||||
if (m->m_pkthdr.len < sizeof(ip))
|
||||
return 0;
|
||||
|
||||
m_copydata(m, 0, sizeof(ip), (caddr_t)&ip);
|
||||
|
||||
switch (ip.ip_v) {
|
||||
|
|
@ -401,7 +405,7 @@ gif_input(m, af, ifp)
|
|||
struct ifnet *ifp;
|
||||
{
|
||||
int isr;
|
||||
struct ifqueue *ifq = 0;
|
||||
struct ifqueue *ifq = NULL;
|
||||
|
||||
if (ifp == NULL) {
|
||||
/* just in case */
|
||||
|
|
@ -491,7 +495,10 @@ gif_ioctl(ifp, cmd, data)
|
|||
struct ifreq *ifr = (struct ifreq*)data;
|
||||
int error = 0, size;
|
||||
struct sockaddr *dst, *src;
|
||||
|
||||
#ifdef SIOCSIFMTU /* xxx */
|
||||
u_long mtu;
|
||||
#endif
|
||||
|
||||
switch (cmd) {
|
||||
case SIOCSIFADDR:
|
||||
ifp->if_flags |= IFF_UP;
|
||||
|
|
@ -509,18 +516,16 @@ gif_ioctl(ifp, cmd, data)
|
|||
break;
|
||||
|
||||
case SIOCSIFMTU:
|
||||
{
|
||||
u_long mtu;
|
||||
mtu = ifr->ifr_mtu;
|
||||
if (mtu < GIF_MTU_MIN || mtu > GIF_MTU_MAX) {
|
||||
return (EINVAL);
|
||||
}
|
||||
ifp->if_mtu = mtu;
|
||||
}
|
||||
mtu = ifr->ifr_mtu;
|
||||
if (mtu < GIF_MTU_MIN || mtu > GIF_MTU_MAX)
|
||||
return (EINVAL);
|
||||
ifp->if_mtu = mtu;
|
||||
break;
|
||||
#endif /* SIOCSIFMTU */
|
||||
|
||||
#ifdef INET
|
||||
case SIOCSIFPHYADDR:
|
||||
#endif
|
||||
#ifdef INET6
|
||||
case SIOCSIFPHYADDR_IN6:
|
||||
#endif /* INET6 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue