ia64/xen-unstable

changeset 1174:576575968828

bitkeeper revision 1.790 (4051df63N_qhNLzJhUL0q78WetTFRg)

dev.c:
Prevent transmitting link-local ARP packets on the wire.
author kaf24@scramble.cl.cam.ac.uk
date Fri Mar 12 16:03:47 2004 +0000 (2004-03-12)
parents 0920098bad91
children fb4fdb5334db
files xen/net/dev.c
line diff
     1.1 --- a/xen/net/dev.c	Fri Mar 12 15:47:50 2004 +0000
     1.2 +++ b/xen/net/dev.c	Fri Mar 12 16:03:47 2004 +0000
     1.3 @@ -1977,10 +1977,19 @@ static int get_tx_bufs(net_vif_t *vif)
     1.4               * some 169.254.* (ie. link-local) packets on the wire unless we 
     1.5               * include this explicit test. :-(
     1.6               */
     1.7 -            if ( (ntohs(*(unsigned short *)(g_data + 12)) == ETH_P_IP) &&
     1.8 -                 ((ntohl(*(unsigned long *)(g_data + 26)) & 0xFFFF0000) == 
     1.9 -                  0xA9FE0000) )
    1.10 -                goto disallow_linklocal_packets;
    1.11 +            switch ( ntohs(*(unsigned short *)(g_data + 12)) )
    1.12 +            {
    1.13 +            case ETH_P_ARP:
    1.14 +                if ( ((ntohl(*(unsigned long *)(g_data + 28)) & 0xFFFF0000) == 
    1.15 +                      0xA9FE0000) )
    1.16 +                    goto disallow_linklocal_packets;
    1.17 +                break;
    1.18 +            case ETH_P_IP:
    1.19 +                if ( ((ntohl(*(unsigned long *)(g_data + 26)) & 0xFFFF0000) == 
    1.20 +                      0xA9FE0000) )
    1.21 +                    goto disallow_linklocal_packets;
    1.22 +                break;
    1.23 +            }
    1.24  
    1.25              stx = &vif->tx_shadow_ring[MASK_NET_TX_IDX(j)];
    1.26              stx->id     = tx.id;