]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[netdevice] Allow link layer to report broadcast/multicast packets via pull()
authorMichael Brown <mcb30@ipxe.org>
Fri, 15 Jul 2011 17:48:46 +0000 (18:48 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 15 Jul 2011 17:48:46 +0000 (18:48 +0100)
Allow the link layer to directly report whether or not a packet is
multicast or broadcast at the time of calling pull(), rather than
relying on heuristics to determine this at a later stage.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
17 files changed:
src/arch/i386/interface/pxe/pxe_undi.c
src/drivers/net/ipoib.c
src/include/ipxe/netdevice.h
src/interface/efi/efi_snp.c
src/net/80211/net80211.c
src/net/aoe.c
src/net/arp.c
src/net/eapol.c
src/net/eth_slow.c
src/net/ethernet.c
src/net/fcoe.c
src/net/ipv4.c
src/net/ipv6.c
src/net/netdevice.c
src/net/rarp.c
src/net/vlan.c
src/usr/lotest.c

index 3938207f163a3b3bed36a1860b3faebda5f018d0..cf8820a02a6609f37ac5536573d9bff7e7f0a595 100644 (file)
@@ -652,6 +652,7 @@ PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr ) {
        const void *ll_dest;
        const void *ll_source;
        uint16_t net_proto;
+       unsigned int flags;
        size_t ll_hlen;
        struct net_protocol *net_protocol;
        unsigned int prottype;
@@ -753,7 +754,8 @@ PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr ) {
                /* Strip link-layer header */
                ll_protocol = pxe_netdev->ll_protocol;
                if ( ( rc = ll_protocol->pull ( pxe_netdev, iobuf, &ll_dest,
-                                               &ll_source, &net_proto )) !=0){
+                                               &ll_source, &net_proto,
+                                               &flags ) ) != 0 ) {
                        /* Assume unknown net_proto and no ll_source */
                        net_proto = 0;
                        ll_source = NULL;
@@ -788,14 +790,12 @@ PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr ) {
                undi_isr->Frame.segment = rm_ds;
                undi_isr->Frame.offset = __from_data16 ( basemem_packet );
                undi_isr->ProtType = prottype;
-               if ( memcmp ( ll_dest, pxe_netdev->ll_addr,
-                             ll_protocol->ll_addr_len ) == 0 ) {
-                       undi_isr->PktType = P_DIRECTED;
-               } else if ( memcmp ( ll_dest, pxe_netdev->ll_broadcast,
-                                    ll_protocol->ll_addr_len ) == 0 ) {
+               if ( flags & LL_BROADCAST ) {
                        undi_isr->PktType = P_BROADCAST;
-               } else {
+               } else if ( flags & LL_MULTICAST ) {
                        undi_isr->PktType = P_MULTICAST;
+               } else {
+                       undi_isr->PktType = P_DIRECTED;
                }
                DBGC2 ( &pxenv_undi_isr, " %04x:%04x+%x(%x) %s hlen %d",
                        undi_isr->Frame.segment, undi_isr->Frame.offset,
index 4917b58e8f570831135ed5bf5f9d63853d4b985d..bc71a456164d112a89d4d0dbc09cb6aec5b71020 100644 (file)
@@ -224,11 +224,13 @@ static int ipoib_push ( struct net_device *netdev __unused,
  * @ret ll_dest                Link-layer destination address
  * @ret ll_source      Source link-layer address
  * @ret net_proto      Network-layer protocol, in network-byte order
+ * @ret flags          Packet flags
  * @ret rc             Return status code
  */
 static int ipoib_pull ( struct net_device *netdev,
                        struct io_buffer *iobuf, const void **ll_dest,
-                       const void **ll_source, uint16_t *net_proto ) {
+                       const void **ll_source, uint16_t *net_proto,
+                       unsigned int *flags ) {
        struct ipoib_device *ipoib = netdev->priv;
        struct ipoib_hdr *ipoib_hdr = iobuf->data;
        struct ipoib_peer *dest;
@@ -255,6 +257,7 @@ static int ipoib_pull ( struct net_device *netdev,
        *ll_dest = ( dest ? &dest->mac : &ipoib->broadcast );
        *ll_source = ( source ? &source->mac : &ipoib->broadcast );
        *net_proto = ipoib_hdr->proto;
+       *flags = ( ( *ll_dest == &ipoib->broadcast ) ? LL_BROADCAST : 0 );
 
        return 0;
 }
index 64285984eab4154170526b21e7cb7c1503ef2c81..3633a1659490ff0a8ed5e944f1190333b6c91dc2 100644 (file)
@@ -66,20 +66,23 @@ struct net_protocol {
        /**
         * Process received packet
         *
-        * @v iobuf     I/O buffer
-        * @v netdev    Network device
-        * @v ll_dest   Link-layer destination address
-        * @v ll_source Link-layer source address
+        * @v iobuf             I/O buffer
+        * @v netdev            Network device
+        * @v ll_dest           Link-layer destination address
+        * @v ll_source         Link-layer source address
+        * @v flags             Packet flags
+        * @ret rc              Return status code
         *
         * This method takes ownership of the I/O buffer.
         */
        int ( * rx ) ( struct io_buffer *iobuf, struct net_device *netdev,
-                      const void *ll_dest, const void *ll_source );
+                      const void *ll_dest, const void *ll_source,
+                      unsigned int flags );
        /**
         * Transcribe network-layer address
         *
-        * @v net_addr  Network-layer address
-        * @ret string  Human-readable transcription of address
+        * @v net_addr          Network-layer address
+        * @ret string          Human-readable transcription of address
         *
         * This method should convert the network-layer address into a
         * human-readable format (e.g. dotted quad notation for IPv4).
@@ -97,6 +100,12 @@ struct net_protocol {
        uint8_t net_addr_len;
 };
 
+/** Packet is a multicast (including broadcast) packet */
+#define LL_MULTICAST 0x0001
+
+/** Packet is a broadcast packet */
+#define LL_BROADCAST 0x0002
+
 /**
  * A link-layer protocol
  *
@@ -125,11 +134,12 @@ struct ll_protocol {
         * @ret ll_dest         Link-layer destination address
         * @ret ll_source       Source link-layer address
         * @ret net_proto       Network-layer protocol, in network-byte order
+        * @ret flags           Packet flags
         * @ret rc              Return status code
         */
        int ( * pull ) ( struct net_device *netdev, struct io_buffer *iobuf,
                         const void **ll_dest, const void **ll_source,
-                        uint16_t *net_proto );
+                        uint16_t *net_proto, unsigned int *flags );
        /**
         * Initialise link-layer address
         *
@@ -611,7 +621,7 @@ extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
                    const void *ll_source );
 extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
                    uint16_t net_proto, const void *ll_dest,
-                   const void *ll_source );
+                   const void *ll_source, unsigned int flags );
 extern void net_poll ( void );
 
 /**
index bc6c0919138f3041a7fca0858584e447dee95609..4c49982672266a29dc0e1eba2cbbd7b5e9d4b17a 100644 (file)
@@ -658,6 +658,7 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
        const void *iob_ll_dest;
        const void *iob_ll_src;
        uint16_t iob_net_proto;
+       unsigned int iob_flags;
        int rc;
        EFI_STATUS efirc;
 
@@ -682,7 +683,8 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
 
        /* Attempt to decode link-layer header */
        if ( ( rc = ll_protocol->pull ( snpdev->netdev, iobuf, &iob_ll_dest,
-                                       &iob_ll_src, &iob_net_proto ) ) != 0 ){
+                                       &iob_ll_src, &iob_net_proto,
+                                       &iob_flags ) ) != 0 ) {
                DBGC ( snpdev, "SNPDEV %p could not parse header: %s\n",
                       snpdev, strerror ( rc ) );
                efirc = RC_TO_EFIRC ( rc );
index 466d1243ef55c6169da526af5b8aa2aa9a828ee2..c00363cd23d9899d44e67756d6478736448188b5 100644 (file)
@@ -135,7 +135,8 @@ static int net80211_ll_push ( struct net_device *netdev,
                              const void *ll_source, uint16_t net_proto );
 static int net80211_ll_pull ( struct net_device *netdev,
                              struct io_buffer *iobuf, const void **ll_dest,
-                             const void **ll_source, uint16_t * net_proto );
+                             const void **ll_source, uint16_t * net_proto,
+                             unsigned int *flags );
 /** @} */
 
 /**
@@ -529,6 +530,7 @@ static int net80211_ll_push ( struct net_device *netdev,
  * @ret ll_dest                Link-layer destination address
  * @ret ll_source      Link-layer source
  * @ret net_proto      Network-layer protocol, in network byte order
+ * @ret flags          Packet flags
  * @ret rc             Return status code
  *
  * This expects and removes both the 802.11 frame header and the 802.2
@@ -537,7 +539,7 @@ static int net80211_ll_push ( struct net_device *netdev,
 static int net80211_ll_pull ( struct net_device *netdev __unused,
                              struct io_buffer *iobuf,
                              const void **ll_dest, const void **ll_source,
-                             uint16_t * net_proto )
+                             uint16_t * net_proto, unsigned int *flags )
 {
        struct ieee80211_frame *hdr = iobuf->data;
        struct ieee80211_llc_snap_header *lhdr =
@@ -586,6 +588,10 @@ static int net80211_ll_pull ( struct net_device *netdev __unused,
        *ll_dest = hdr->addr1;
        *ll_source = hdr->addr3;
        *net_proto = lhdr->ethertype;
+       *flags = ( ( is_multicast_ether_addr ( hdr->addr1 ) ?
+                    LL_MULTICAST : 0 ) |
+                  ( is_broadcast_ether_addr ( hdr->addr1 ) ?
+                    LL_BROADCAST : 0 ) );
        return 0;
 }
 
index 3b1953a2fda5ac3488d89abd46eeee5b63ea1e66..1016b2509e0369dfa541f464f08c4ee8d9095bbe 100644 (file)
@@ -906,13 +906,14 @@ static int aoedev_open ( struct interface *parent, struct net_device *netdev,
  * @v netdev           Network device
  * @v ll_dest          Link-layer destination address
  * @v ll_source                Link-layer source address
+ * @v flags            Packet flags
  * @ret rc             Return status code
- *
  */
 static int aoe_rx ( struct io_buffer *iobuf,
                    struct net_device *netdev __unused,
                    const void *ll_dest __unused,
-                   const void *ll_source ) {
+                   const void *ll_source,
+                   unsigned int flags __unused ) {
        struct aoehdr *aoehdr = iobuf->data;
        struct aoe_command *aoecmd;
        int rc;
index 9b5fd220efd7a9311376dc40be3541012a22ea16..ef30d5ecde209141e43bf7844e82280fa12e8182 100644 (file)
@@ -186,6 +186,7 @@ static struct arp_net_protocol * arp_find_protocol ( uint16_t net_proto ) {
  * @v iobuf            I/O buffer
  * @v netdev           Network device
  * @v ll_source                Link-layer source address
+ * @v flags            Packet flags
  * @ret rc             Return status code
  *
  * This handles ARP requests and responses as detailed in RFC826.  The
@@ -196,7 +197,8 @@ static struct arp_net_protocol * arp_find_protocol ( uint16_t net_proto ) {
  */
 static int arp_rx ( struct io_buffer *iobuf, struct net_device *netdev,
                    const void *ll_dest __unused,
-                   const void *ll_source __unused ) {
+                   const void *ll_source __unused,
+                   unsigned int flags __unused ) {
        struct arphdr *arphdr = iobuf->data;
        struct arp_net_protocol *arp_net_protocol;
        struct net_protocol *net_protocol;
index 9e5f2640157a57f52214c136af3f816db645039d..dd04208394d5c23f793d5ae06e5b733aff27a4dc 100644 (file)
@@ -38,11 +38,13 @@ FILE_LICENCE ( GPL2_OR_LATER );
  * @v netdev   Network device
  * @v ll_dest  Link-layer destination address
  * @v ll_source        Link-layer source address
+ * @v flags    Packet flags
  *
  * This function takes ownership of the I/O buffer passed to it.
  */
 static int eapol_rx ( struct io_buffer *iob, struct net_device *netdev,
-                     const void *ll_dest, const void *ll_source ) {
+                     const void *ll_dest, const void *ll_source,
+                     unsigned int flags __unused ) {
        struct eapol_frame *eapol = iob->data;
        struct eapol_handler *handler;
 
index 9e68939cf3789ea2ffe65c9efd56a5ad9318fd2d..593e45bc10457642703b5360a0ac7b5676225716 100644 (file)
@@ -234,12 +234,14 @@ static int eth_slow_marker_rx ( struct io_buffer *iobuf,
  * @v netdev           Network device
  * @v ll_dest          Link-layer destination address
  * @v ll_source                Link-layer source address
+ * @v flags            Packet flags
  * @ret rc             Return status code
  */
 static int eth_slow_rx ( struct io_buffer *iobuf,
                         struct net_device *netdev,
                         const void *ll_dest __unused,
-                        const void *ll_source __unused ) {
+                        const void *ll_source __unused,
+                        unsigned int flags __unused ) {
        union eth_slow_packet *eth_slow = iobuf->data;
 
        /* Sanity checks */
index d14cfefcc1259f7eade913539c96a73bf60ba00d..c63fd9bc341c7839fcd4f9ff1869aa847a29acd7 100644 (file)
@@ -71,11 +71,13 @@ static int eth_push ( struct net_device *netdev __unused,
  * @ret ll_dest                Link-layer destination address
  * @ret ll_source      Source link-layer address
  * @ret net_proto      Network-layer protocol, in network-byte order
+ * @ret flags          Packet flags
  * @ret rc             Return status code
  */
 static int eth_pull ( struct net_device *netdev __unused, 
                      struct io_buffer *iobuf, const void **ll_dest,
-                     const void **ll_source, uint16_t *net_proto ) {
+                     const void **ll_source, uint16_t *net_proto,
+                     unsigned int *flags ) {
        struct ethhdr *ethhdr = iobuf->data;
 
        /* Sanity check */
@@ -92,6 +94,10 @@ static int eth_pull ( struct net_device *netdev __unused,
        *ll_dest = ethhdr->h_dest;
        *ll_source = ethhdr->h_source;
        *net_proto = ethhdr->h_protocol;
+       *flags = ( ( is_multicast_ether_addr ( ethhdr->h_dest ) ?
+                    LL_MULTICAST : 0 ) |
+                  ( is_broadcast_ether_addr ( ethhdr->h_dest ) ?
+                    LL_BROADCAST : 0 ) );
 
        return 0;
 }
index db2fc980645c59ceb04f734c5b393a4a691bbfda..c54d1b4749cef787fbc65553e85f329b775c7d92 100644 (file)
@@ -331,10 +331,12 @@ static struct io_buffer * fcoe_alloc_iob ( struct fcoe_port *fcoe __unused,
  * @v netdev           Network device
  * @v ll_dest          Link-layer destination address
  * @v ll_source                Link-layer source address
+ * @v flags            Packet flags
  * @ret rc             Return status code
  */
 static int fcoe_rx ( struct io_buffer *iobuf, struct net_device *netdev,
-                    const void *ll_dest, const void *ll_source ) {
+                    const void *ll_dest, const void *ll_source,
+                    unsigned int flags __unused ) {
        struct fcoe_header *fcoehdr;
        struct fcoe_footer *fcoeftr;
        struct fcoe_port *fcoe;
@@ -924,12 +926,14 @@ static struct fip_handler fip_handlers[] = {
  * @v netdev           Network device
  * @v ll_dest          Link-layer destination address
  * @v ll_source                Link-layer source address
+ * @v flags            Packet flags
  * @ret rc             Return status code
  */
 static int fcoe_fip_rx ( struct io_buffer *iobuf,
                         struct net_device *netdev,
                         const void *ll_dest,
-                        const void *ll_source __unused ) {
+                        const void *ll_source __unused,
+                        unsigned int flags __unused ) {
        struct fip_header *fiphdr = iobuf->data;
        struct fip_descriptors descs;
        struct fip_handler *handler;
index 5bb48f61ca8063f762df4ed37559a287f7c7a6a5..01eca09d81ee0f16784fc6239a3c40ceb07da7ea 100644 (file)
@@ -381,10 +381,12 @@ static int ipv4_tx ( struct io_buffer *iobuf,
 /**
  * Process incoming packets
  *
- * @v iobuf    I/O buffer
- * @v netdev   Network device
- * @v ll_dest  Link-layer destination address
- * @v ll_source        Link-layer destination source
+ * @v iobuf            I/O buffer
+ * @v netdev           Network device
+ * @v ll_dest          Link-layer destination address
+ * @v ll_source                Link-layer destination source
+ * @v flags            Packet flags
+ * @ret rc             Return status code
  *
  * This function expects an IP4 network datagram. It processes the headers 
  * and sends it to the transport layer.
@@ -392,7 +394,8 @@ static int ipv4_tx ( struct io_buffer *iobuf,
 static int ipv4_rx ( struct io_buffer *iobuf,
                     struct net_device *netdev __unused,
                     const void *ll_dest __unused,
-                    const void *ll_source __unused ) {
+                    const void *ll_source __unused,
+                    unsigned int flags __unused ) {
        struct iphdr *iphdr = iobuf->data;
        size_t hdrlen;
        size_t len;
index 712aa49e5459de2db9cc059747c6c6080dde6e17..57bf94d8d9d5c1b891c168eb1d7eb4689a4473f2 100644 (file)
@@ -288,13 +288,15 @@ static int ipv6_process_nxt_hdr ( struct io_buffer *iobuf, uint8_t nxt_hdr,
  * @v netdev           Network device
  * @v ll_dest          Link-layer destination address
  * @v ll_source                Link-layer source address
+ * @v flags            Packet flags
  *
  * This function processes a IPv6 packet
  */
 static int ipv6_rx ( struct io_buffer *iobuf,
                     __unused struct net_device *netdev,
                     __unused const void *ll_dest,
-                    __unused const void *ll_source ) {
+                    __unused const void *ll_source,
+                    __unused unsigned int flags ) {
 
        struct ip6_header *ip6hdr = iobuf->data;
        union {
index 52ad829254823d5a99aaa4e312fe373408cc350d..f5ec4191fb584f46a80ad4ce363e34e4d81ecf2b 100644 (file)
@@ -678,17 +678,19 @@ int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
  * @v net_proto                Network-layer protocol, in network-byte order
  * @v ll_dest          Destination link-layer address
  * @v ll_source                Source link-layer address
+ * @v flags            Packet flags
  * @ret rc             Return status code
  */
 int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
-            uint16_t net_proto, const void *ll_dest, const void *ll_source ) {
+            uint16_t net_proto, const void *ll_dest, const void *ll_source,
+            unsigned int flags ) {
        struct net_protocol *net_protocol;
 
        /* Hand off to network-layer protocol, if any */
        for_each_table_entry ( net_protocol, NET_PROTOCOLS ) {
                if ( net_protocol->net_proto == net_proto )
                        return net_protocol->rx ( iobuf, netdev, ll_dest,
-                                                 ll_source );
+                                                 ll_source, flags );
        }
 
        DBGC ( netdev, "NETDEV %s unknown network protocol %04x\n",
@@ -710,6 +712,7 @@ void net_poll ( void ) {
        const void *ll_dest;
        const void *ll_source;
        uint16_t net_proto;
+       unsigned int flags;
        int rc;
 
        /* Poll and process each network device */
@@ -743,7 +746,8 @@ void net_poll ( void ) {
                        ll_protocol = netdev->ll_protocol;
                        if ( ( rc = ll_protocol->pull ( netdev, iobuf,
                                                        &ll_dest, &ll_source,
-                                                       &net_proto ) ) != 0 ) {
+                                                       &net_proto,
+                                                       &flags ) ) != 0 ) {
                                free_iob ( iobuf );
                                continue;
                        }
@@ -751,7 +755,7 @@ void net_poll ( void ) {
                        /* Hand packet to network layer */
                        if ( ( rc = net_rx ( iob_disown ( iobuf ), netdev,
                                             net_proto, ll_dest,
-                                            ll_source ) ) != 0 ) {
+                                            ll_source, flags ) ) != 0 ) {
                                /* Record error for diagnosis */
                                netdev_rx_err ( netdev, NULL, rc );
                        }
index da67c459dba2a9b9e0fba0029e97503f02b66f4b..59cb1d07f2cc1a837ec09abc748c967a42865184 100644 (file)
@@ -38,6 +38,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
  * @v netdev           Network device
  * @v ll_dest          Link-layer destination address
  * @v ll_source                Link-layer source address
+ * @v flags            Packet flags
  * @ret rc             Return status code
  *
  * This is a dummy method which simply discards RARP packets.
@@ -45,7 +46,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
 static int rarp_rx ( struct io_buffer *iobuf,
                     struct net_device *netdev __unused,
                     const void *ll_dest __unused,
-                    const void *ll_source __unused ) {
+                    const void *ll_source __unused,
+                    unsigned int flags __unused ) {
        free_iob ( iobuf );
        return 0;
 }
index 9ac560f1e8a0a9594eac85015d48192752e2fc38..2147f91c555b026c80cd1e4497d6c22b68727f95 100644 (file)
@@ -91,12 +91,13 @@ static int vlan_transmit ( struct net_device *netdev,
        const void *ll_dest;
        const void *ll_source;
        uint16_t net_proto;
+       unsigned int flags;
        int rc;
 
        /* Strip link-layer header and preserve link-layer header fields */
        ll_protocol = netdev->ll_protocol;
        if ( ( rc = ll_protocol->pull ( netdev, iobuf, &ll_dest, &ll_source,
-                                       &net_proto ) ) != 0 ) {
+                                       &net_proto, &flags ) ) != 0 ) {
                DBGC ( netdev, "VLAN %s could not parse link-layer header: "
                       "%s\n", netdev->name, strerror ( rc ) );
                return rc;
@@ -214,10 +215,12 @@ struct net_device * vlan_find ( struct net_device *trunk, unsigned int tag ) {
  * @v trunk            Trunk network device
  * @v ll_dest          Link-layer destination address
  * @v ll_source                Link-layer source address
+ * @v flags            Packet flags
  * @ret rc             Return status code
  */
 static int vlan_rx ( struct io_buffer *iobuf, struct net_device *trunk,
-                    const void *ll_dest, const void *ll_source ) {
+                    const void *ll_dest, const void *ll_source,
+                    unsigned int flags __unused ) {
        struct vlan_header *vlanhdr = iobuf->data;
        struct net_device *netdev;
        struct ll_protocol *ll_protocol;
index 7f9f2fd0780f9e64833e7cc208f29d34634ff7dd..6ed31ea5444cd9a097d786b2a4fd9f956110b044 100644 (file)
@@ -47,12 +47,14 @@ FILE_LICENCE ( GPL2_OR_LATER );
  * @v netdev           Network device
  * @v ll_dest          Link-layer destination address
  * @v ll_source                Link-layer source address
+ * @v flags            Packet flags
  * @ret rc             Return status code
  */
 static int lotest_rx ( struct io_buffer *iobuf,
                       struct net_device *netdev __unused,
                       const void *ll_dest __unused,
-                      const void *ll_source __unused ) {
+                      const void *ll_source __unused,
+                      unsigned int flags __unused ) {
        free_iob ( iobuf );
        return -ENOTSUP;
 }
@@ -97,6 +99,7 @@ int loopback_test ( struct net_device *sender, struct net_device *receiver,
        const void *ll_dest;
        const void *ll_source;
        uint16_t net_proto;
+       unsigned int flags;
        unsigned int i;
        unsigned int successes;
        int rc;
@@ -166,7 +169,8 @@ int loopback_test ( struct net_device *sender, struct net_device *receiver,
                /* Check received packet */
                if ( ( rc = receiver->ll_protocol->pull ( receiver, iobuf,
                                                          &ll_dest, &ll_source,
-                                                         &net_proto ) ) != 0 ){
+                                                         &net_proto,
+                                                         &flags ) ) != 0 ) {
                        printf ( "\nFailed to strip link-layer header: %s",
                                 strerror ( rc ) );
                        goto done;