Sfoglia il codice sorgente

[netdevice] Allow link layer to report broadcast/multicast packets via pull()

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>
tags/v1.20.1
Michael Brown 13 anni fa
parent
commit
a667bf044a

+ 7
- 7
src/arch/i386/interface/pxe/pxe_undi.c Vedi File

@@ -652,6 +652,7 @@ PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr ) {
652 652
 	const void *ll_dest;
653 653
 	const void *ll_source;
654 654
 	uint16_t net_proto;
655
+	unsigned int flags;
655 656
 	size_t ll_hlen;
656 657
 	struct net_protocol *net_protocol;
657 658
 	unsigned int prottype;
@@ -753,7 +754,8 @@ PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr ) {
753 754
 		/* Strip link-layer header */
754 755
 		ll_protocol = pxe_netdev->ll_protocol;
755 756
 		if ( ( rc = ll_protocol->pull ( pxe_netdev, iobuf, &ll_dest,
756
-						&ll_source, &net_proto )) !=0){
757
+						&ll_source, &net_proto,
758
+						&flags ) ) != 0 ) {
757 759
 			/* Assume unknown net_proto and no ll_source */
758 760
 			net_proto = 0;
759 761
 			ll_source = NULL;
@@ -788,14 +790,12 @@ PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr ) {
788 790
 		undi_isr->Frame.segment = rm_ds;
789 791
 		undi_isr->Frame.offset = __from_data16 ( basemem_packet );
790 792
 		undi_isr->ProtType = prottype;
791
-		if ( memcmp ( ll_dest, pxe_netdev->ll_addr,
792
-			      ll_protocol->ll_addr_len ) == 0 ) {
793
-			undi_isr->PktType = P_DIRECTED;
794
-		} else if ( memcmp ( ll_dest, pxe_netdev->ll_broadcast,
795
-				     ll_protocol->ll_addr_len ) == 0 ) {
793
+		if ( flags & LL_BROADCAST ) {
796 794
 			undi_isr->PktType = P_BROADCAST;
797
-		} else {
795
+		} else if ( flags & LL_MULTICAST ) {
798 796
 			undi_isr->PktType = P_MULTICAST;
797
+		} else {
798
+			undi_isr->PktType = P_DIRECTED;
799 799
 		}
800 800
 		DBGC2 ( &pxenv_undi_isr, " %04x:%04x+%x(%x) %s hlen %d",
801 801
 			undi_isr->Frame.segment, undi_isr->Frame.offset,

+ 4
- 1
src/drivers/net/ipoib.c Vedi File

@@ -224,11 +224,13 @@ static int ipoib_push ( struct net_device *netdev __unused,
224 224
  * @ret ll_dest		Link-layer destination address
225 225
  * @ret ll_source	Source link-layer address
226 226
  * @ret net_proto	Network-layer protocol, in network-byte order
227
+ * @ret flags		Packet flags
227 228
  * @ret rc		Return status code
228 229
  */
229 230
 static int ipoib_pull ( struct net_device *netdev,
230 231
 			struct io_buffer *iobuf, const void **ll_dest,
231
-			const void **ll_source, uint16_t *net_proto ) {
232
+			const void **ll_source, uint16_t *net_proto,
233
+			unsigned int *flags ) {
232 234
 	struct ipoib_device *ipoib = netdev->priv;
233 235
 	struct ipoib_hdr *ipoib_hdr = iobuf->data;
234 236
 	struct ipoib_peer *dest;
@@ -255,6 +257,7 @@ static int ipoib_pull ( struct net_device *netdev,
255 257
 	*ll_dest = ( dest ? &dest->mac : &ipoib->broadcast );
256 258
 	*ll_source = ( source ? &source->mac : &ipoib->broadcast );
257 259
 	*net_proto = ipoib_hdr->proto;
260
+	*flags = ( ( *ll_dest == &ipoib->broadcast ) ? LL_BROADCAST : 0 );
258 261
 
259 262
 	return 0;
260 263
 }

+ 19
- 9
src/include/ipxe/netdevice.h Vedi File

@@ -66,20 +66,23 @@ struct net_protocol {
66 66
 	/**
67 67
 	 * Process received packet
68 68
 	 *
69
-	 * @v iobuf	I/O buffer
70
-	 * @v netdev	Network device
71
-	 * @v ll_dest	Link-layer destination address
72
-	 * @v ll_source	Link-layer source address
69
+	 * @v iobuf		I/O buffer
70
+	 * @v netdev		Network device
71
+	 * @v ll_dest		Link-layer destination address
72
+	 * @v ll_source		Link-layer source address
73
+	 * @v flags		Packet flags
74
+	 * @ret rc		Return status code
73 75
 	 *
74 76
 	 * This method takes ownership of the I/O buffer.
75 77
 	 */
76 78
 	int ( * rx ) ( struct io_buffer *iobuf, struct net_device *netdev,
77
-		       const void *ll_dest, const void *ll_source );
79
+		       const void *ll_dest, const void *ll_source,
80
+		       unsigned int flags );
78 81
 	/**
79 82
 	 * Transcribe network-layer address
80 83
 	 *
81
-	 * @v net_addr	Network-layer address
82
-	 * @ret string	Human-readable transcription of address
84
+	 * @v net_addr		Network-layer address
85
+	 * @ret string		Human-readable transcription of address
83 86
 	 *
84 87
 	 * This method should convert the network-layer address into a
85 88
 	 * human-readable format (e.g. dotted quad notation for IPv4).
@@ -97,6 +100,12 @@ struct net_protocol {
97 100
 	uint8_t net_addr_len;
98 101
 };
99 102
 
103
+/** Packet is a multicast (including broadcast) packet */
104
+#define LL_MULTICAST 0x0001
105
+
106
+/** Packet is a broadcast packet */
107
+#define LL_BROADCAST 0x0002
108
+
100 109
 /**
101 110
  * A link-layer protocol
102 111
  *
@@ -125,11 +134,12 @@ struct ll_protocol {
125 134
 	 * @ret ll_dest		Link-layer destination address
126 135
 	 * @ret ll_source	Source link-layer address
127 136
 	 * @ret net_proto	Network-layer protocol, in network-byte order
137
+	 * @ret flags		Packet flags
128 138
 	 * @ret rc		Return status code
129 139
 	 */
130 140
 	int ( * pull ) ( struct net_device *netdev, struct io_buffer *iobuf,
131 141
 			 const void **ll_dest, const void **ll_source,
132
-			 uint16_t *net_proto );
142
+			 uint16_t *net_proto, unsigned int *flags );
133 143
 	/**
134 144
 	 * Initialise link-layer address
135 145
 	 *
@@ -611,7 +621,7 @@ extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
611 621
 		    const void *ll_source );
612 622
 extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
613 623
 		    uint16_t net_proto, const void *ll_dest,
614
-		    const void *ll_source );
624
+		    const void *ll_source, unsigned int flags );
615 625
 extern void net_poll ( void );
616 626
 
617 627
 /**

+ 3
- 1
src/interface/efi/efi_snp.c Vedi File

@@ -658,6 +658,7 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
658 658
 	const void *iob_ll_dest;
659 659
 	const void *iob_ll_src;
660 660
 	uint16_t iob_net_proto;
661
+	unsigned int iob_flags;
661 662
 	int rc;
662 663
 	EFI_STATUS efirc;
663 664
 
@@ -682,7 +683,8 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
682 683
 
683 684
 	/* Attempt to decode link-layer header */
684 685
 	if ( ( rc = ll_protocol->pull ( snpdev->netdev, iobuf, &iob_ll_dest,
685
-					&iob_ll_src, &iob_net_proto ) ) != 0 ){
686
+					&iob_ll_src, &iob_net_proto,
687
+					&iob_flags ) ) != 0 ) {
686 688
 		DBGC ( snpdev, "SNPDEV %p could not parse header: %s\n",
687 689
 		       snpdev, strerror ( rc ) );
688 690
 		efirc = RC_TO_EFIRC ( rc );

+ 8
- 2
src/net/80211/net80211.c Vedi File

@@ -135,7 +135,8 @@ static int net80211_ll_push ( struct net_device *netdev,
135 135
 			      const void *ll_source, uint16_t net_proto );
136 136
 static int net80211_ll_pull ( struct net_device *netdev,
137 137
 			      struct io_buffer *iobuf, const void **ll_dest,
138
-			      const void **ll_source, uint16_t * net_proto );
138
+			      const void **ll_source, uint16_t * net_proto,
139
+			      unsigned int *flags );
139 140
 /** @} */
140 141
 
141 142
 /**
@@ -529,6 +530,7 @@ static int net80211_ll_push ( struct net_device *netdev,
529 530
  * @ret ll_dest		Link-layer destination address
530 531
  * @ret ll_source	Link-layer source
531 532
  * @ret net_proto	Network-layer protocol, in network byte order
533
+ * @ret flags		Packet flags
532 534
  * @ret rc		Return status code
533 535
  *
534 536
  * 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,
537 539
 static int net80211_ll_pull ( struct net_device *netdev __unused,
538 540
 			      struct io_buffer *iobuf,
539 541
 			      const void **ll_dest, const void **ll_source,
540
-			      uint16_t * net_proto )
542
+			      uint16_t * net_proto, unsigned int *flags )
541 543
 {
542 544
 	struct ieee80211_frame *hdr = iobuf->data;
543 545
 	struct ieee80211_llc_snap_header *lhdr =
@@ -586,6 +588,10 @@ static int net80211_ll_pull ( struct net_device *netdev __unused,
586 588
 	*ll_dest = hdr->addr1;
587 589
 	*ll_source = hdr->addr3;
588 590
 	*net_proto = lhdr->ethertype;
591
+	*flags = ( ( is_multicast_ether_addr ( hdr->addr1 ) ?
592
+		     LL_MULTICAST : 0 ) |
593
+		   ( is_broadcast_ether_addr ( hdr->addr1 ) ?
594
+		     LL_BROADCAST : 0 ) );
589 595
 	return 0;
590 596
 }
591 597
 

+ 3
- 2
src/net/aoe.c Vedi File

@@ -906,13 +906,14 @@ static int aoedev_open ( struct interface *parent, struct net_device *netdev,
906 906
  * @v netdev		Network device
907 907
  * @v ll_dest		Link-layer destination address
908 908
  * @v ll_source		Link-layer source address
909
+ * @v flags		Packet flags
909 910
  * @ret rc		Return status code
910
- *
911 911
  */
912 912
 static int aoe_rx ( struct io_buffer *iobuf,
913 913
 		    struct net_device *netdev __unused,
914 914
 		    const void *ll_dest __unused,
915
-		    const void *ll_source ) {
915
+		    const void *ll_source,
916
+		    unsigned int flags __unused ) {
916 917
 	struct aoehdr *aoehdr = iobuf->data;
917 918
 	struct aoe_command *aoecmd;
918 919
 	int rc;

+ 3
- 1
src/net/arp.c Vedi File

@@ -186,6 +186,7 @@ static struct arp_net_protocol * arp_find_protocol ( uint16_t net_proto ) {
186 186
  * @v iobuf		I/O buffer
187 187
  * @v netdev		Network device
188 188
  * @v ll_source		Link-layer source address
189
+ * @v flags		Packet flags
189 190
  * @ret rc		Return status code
190 191
  *
191 192
  * 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 ) {
196 197
  */
197 198
 static int arp_rx ( struct io_buffer *iobuf, struct net_device *netdev,
198 199
 		    const void *ll_dest __unused,
199
-		    const void *ll_source __unused ) {
200
+		    const void *ll_source __unused,
201
+		    unsigned int flags __unused ) {
200 202
 	struct arphdr *arphdr = iobuf->data;
201 203
 	struct arp_net_protocol *arp_net_protocol;
202 204
 	struct net_protocol *net_protocol;

+ 3
- 1
src/net/eapol.c Vedi File

@@ -38,11 +38,13 @@ FILE_LICENCE ( GPL2_OR_LATER );
38 38
  * @v netdev	Network device
39 39
  * @v ll_dest	Link-layer destination address
40 40
  * @v ll_source	Link-layer source address
41
+ * @v flags	Packet flags
41 42
  *
42 43
  * This function takes ownership of the I/O buffer passed to it.
43 44
  */
44 45
 static int eapol_rx ( struct io_buffer *iob, struct net_device *netdev,
45
-		      const void *ll_dest, const void *ll_source ) {
46
+		      const void *ll_dest, const void *ll_source,
47
+		      unsigned int flags __unused ) {
46 48
 	struct eapol_frame *eapol = iob->data;
47 49
 	struct eapol_handler *handler;
48 50
 

+ 3
- 1
src/net/eth_slow.c Vedi File

@@ -234,12 +234,14 @@ static int eth_slow_marker_rx ( struct io_buffer *iobuf,
234 234
  * @v netdev		Network device
235 235
  * @v ll_dest		Link-layer destination address
236 236
  * @v ll_source		Link-layer source address
237
+ * @v flags		Packet flags
237 238
  * @ret rc		Return status code
238 239
  */
239 240
 static int eth_slow_rx ( struct io_buffer *iobuf,
240 241
 			 struct net_device *netdev,
241 242
 			 const void *ll_dest __unused,
242
-			 const void *ll_source __unused ) {
243
+			 const void *ll_source __unused,
244
+			 unsigned int flags __unused ) {
243 245
 	union eth_slow_packet *eth_slow = iobuf->data;
244 246
 
245 247
 	/* Sanity checks */

+ 7
- 1
src/net/ethernet.c Vedi File

@@ -71,11 +71,13 @@ static int eth_push ( struct net_device *netdev __unused,
71 71
  * @ret ll_dest		Link-layer destination address
72 72
  * @ret ll_source	Source link-layer address
73 73
  * @ret net_proto	Network-layer protocol, in network-byte order
74
+ * @ret flags		Packet flags
74 75
  * @ret rc		Return status code
75 76
  */
76 77
 static int eth_pull ( struct net_device *netdev __unused, 
77 78
 		      struct io_buffer *iobuf, const void **ll_dest,
78
-		      const void **ll_source, uint16_t *net_proto ) {
79
+		      const void **ll_source, uint16_t *net_proto,
80
+		      unsigned int *flags ) {
79 81
 	struct ethhdr *ethhdr = iobuf->data;
80 82
 
81 83
 	/* Sanity check */
@@ -92,6 +94,10 @@ static int eth_pull ( struct net_device *netdev __unused,
92 94
 	*ll_dest = ethhdr->h_dest;
93 95
 	*ll_source = ethhdr->h_source;
94 96
 	*net_proto = ethhdr->h_protocol;
97
+	*flags = ( ( is_multicast_ether_addr ( ethhdr->h_dest ) ?
98
+		     LL_MULTICAST : 0 ) |
99
+		   ( is_broadcast_ether_addr ( ethhdr->h_dest ) ?
100
+		     LL_BROADCAST : 0 ) );
95 101
 
96 102
 	return 0;
97 103
 }

+ 6
- 2
src/net/fcoe.c Vedi File

@@ -331,10 +331,12 @@ static struct io_buffer * fcoe_alloc_iob ( struct fcoe_port *fcoe __unused,
331 331
  * @v netdev		Network device
332 332
  * @v ll_dest		Link-layer destination address
333 333
  * @v ll_source		Link-layer source address
334
+ * @v flags		Packet flags
334 335
  * @ret rc		Return status code
335 336
  */
336 337
 static int fcoe_rx ( struct io_buffer *iobuf, struct net_device *netdev,
337
-		     const void *ll_dest, const void *ll_source ) {
338
+		     const void *ll_dest, const void *ll_source,
339
+		     unsigned int flags __unused ) {
338 340
 	struct fcoe_header *fcoehdr;
339 341
 	struct fcoe_footer *fcoeftr;
340 342
 	struct fcoe_port *fcoe;
@@ -924,12 +926,14 @@ static struct fip_handler fip_handlers[] = {
924 926
  * @v netdev		Network device
925 927
  * @v ll_dest		Link-layer destination address
926 928
  * @v ll_source		Link-layer source address
929
+ * @v flags		Packet flags
927 930
  * @ret rc		Return status code
928 931
  */
929 932
 static int fcoe_fip_rx ( struct io_buffer *iobuf,
930 933
 			 struct net_device *netdev,
931 934
 			 const void *ll_dest,
932
-			 const void *ll_source __unused ) {
935
+			 const void *ll_source __unused,
936
+			 unsigned int flags __unused ) {
933 937
 	struct fip_header *fiphdr = iobuf->data;
934 938
 	struct fip_descriptors descs;
935 939
 	struct fip_handler *handler;

+ 8
- 5
src/net/ipv4.c Vedi File

@@ -381,10 +381,12 @@ static int ipv4_tx ( struct io_buffer *iobuf,
381 381
 /**
382 382
  * Process incoming packets
383 383
  *
384
- * @v iobuf	I/O buffer
385
- * @v netdev	Network device
386
- * @v ll_dest	Link-layer destination address
387
- * @v ll_source	Link-layer destination source
384
+ * @v iobuf		I/O buffer
385
+ * @v netdev		Network device
386
+ * @v ll_dest		Link-layer destination address
387
+ * @v ll_source		Link-layer destination source
388
+ * @v flags		Packet flags
389
+ * @ret rc		Return status code
388 390
  *
389 391
  * This function expects an IP4 network datagram. It processes the headers 
390 392
  * and sends it to the transport layer.
@@ -392,7 +394,8 @@ static int ipv4_tx ( struct io_buffer *iobuf,
392 394
 static int ipv4_rx ( struct io_buffer *iobuf,
393 395
 		     struct net_device *netdev __unused,
394 396
 		     const void *ll_dest __unused,
395
-		     const void *ll_source __unused ) {
397
+		     const void *ll_source __unused,
398
+		     unsigned int flags __unused ) {
396 399
 	struct iphdr *iphdr = iobuf->data;
397 400
 	size_t hdrlen;
398 401
 	size_t len;

+ 3
- 1
src/net/ipv6.c Vedi File

@@ -288,13 +288,15 @@ static int ipv6_process_nxt_hdr ( struct io_buffer *iobuf, uint8_t nxt_hdr,
288 288
  * @v netdev		Network device
289 289
  * @v ll_dest		Link-layer destination address
290 290
  * @v ll_source		Link-layer source address
291
+ * @v flags		Packet flags
291 292
  *
292 293
  * This function processes a IPv6 packet
293 294
  */
294 295
 static int ipv6_rx ( struct io_buffer *iobuf,
295 296
 		     __unused struct net_device *netdev,
296 297
 		     __unused const void *ll_dest,
297
-		     __unused const void *ll_source ) {
298
+		     __unused const void *ll_source,
299
+		     __unused unsigned int flags ) {
298 300
 
299 301
 	struct ip6_header *ip6hdr = iobuf->data;
300 302
 	union {

+ 8
- 4
src/net/netdevice.c Vedi File

@@ -678,17 +678,19 @@ int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
678 678
  * @v net_proto		Network-layer protocol, in network-byte order
679 679
  * @v ll_dest		Destination link-layer address
680 680
  * @v ll_source		Source link-layer address
681
+ * @v flags		Packet flags
681 682
  * @ret rc		Return status code
682 683
  */
683 684
 int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
684
-	     uint16_t net_proto, const void *ll_dest, const void *ll_source ) {
685
+	     uint16_t net_proto, const void *ll_dest, const void *ll_source,
686
+	     unsigned int flags ) {
685 687
 	struct net_protocol *net_protocol;
686 688
 
687 689
 	/* Hand off to network-layer protocol, if any */
688 690
 	for_each_table_entry ( net_protocol, NET_PROTOCOLS ) {
689 691
 		if ( net_protocol->net_proto == net_proto )
690 692
 			return net_protocol->rx ( iobuf, netdev, ll_dest,
691
-						  ll_source );
693
+						  ll_source, flags );
692 694
 	}
693 695
 
694 696
 	DBGC ( netdev, "NETDEV %s unknown network protocol %04x\n",
@@ -710,6 +712,7 @@ void net_poll ( void ) {
710 712
 	const void *ll_dest;
711 713
 	const void *ll_source;
712 714
 	uint16_t net_proto;
715
+	unsigned int flags;
713 716
 	int rc;
714 717
 
715 718
 	/* Poll and process each network device */
@@ -743,7 +746,8 @@ void net_poll ( void ) {
743 746
 			ll_protocol = netdev->ll_protocol;
744 747
 			if ( ( rc = ll_protocol->pull ( netdev, iobuf,
745 748
 							&ll_dest, &ll_source,
746
-							&net_proto ) ) != 0 ) {
749
+							&net_proto,
750
+							&flags ) ) != 0 ) {
747 751
 				free_iob ( iobuf );
748 752
 				continue;
749 753
 			}
@@ -751,7 +755,7 @@ void net_poll ( void ) {
751 755
 			/* Hand packet to network layer */
752 756
 			if ( ( rc = net_rx ( iob_disown ( iobuf ), netdev,
753 757
 					     net_proto, ll_dest,
754
-					     ll_source ) ) != 0 ) {
758
+					     ll_source, flags ) ) != 0 ) {
755 759
 				/* Record error for diagnosis */
756 760
 				netdev_rx_err ( netdev, NULL, rc );
757 761
 			}

+ 3
- 1
src/net/rarp.c Vedi File

@@ -38,6 +38,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
38 38
  * @v netdev		Network device
39 39
  * @v ll_dest		Link-layer destination address
40 40
  * @v ll_source		Link-layer source address
41
+ * @v flags		Packet flags
41 42
  * @ret rc		Return status code
42 43
  *
43 44
  * This is a dummy method which simply discards RARP packets.
@@ -45,7 +46,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
45 46
 static int rarp_rx ( struct io_buffer *iobuf,
46 47
 		     struct net_device *netdev __unused,
47 48
 		     const void *ll_dest __unused,
48
-		     const void *ll_source __unused ) {
49
+		     const void *ll_source __unused,
50
+		     unsigned int flags __unused ) {
49 51
 	free_iob ( iobuf );
50 52
 	return 0;
51 53
 }

+ 5
- 2
src/net/vlan.c Vedi File

@@ -91,12 +91,13 @@ static int vlan_transmit ( struct net_device *netdev,
91 91
 	const void *ll_dest;
92 92
 	const void *ll_source;
93 93
 	uint16_t net_proto;
94
+	unsigned int flags;
94 95
 	int rc;
95 96
 
96 97
 	/* Strip link-layer header and preserve link-layer header fields */
97 98
 	ll_protocol = netdev->ll_protocol;
98 99
 	if ( ( rc = ll_protocol->pull ( netdev, iobuf, &ll_dest, &ll_source,
99
-					&net_proto ) ) != 0 ) {
100
+					&net_proto, &flags ) ) != 0 ) {
100 101
 		DBGC ( netdev, "VLAN %s could not parse link-layer header: "
101 102
 		       "%s\n", netdev->name, strerror ( rc ) );
102 103
 		return rc;
@@ -214,10 +215,12 @@ struct net_device * vlan_find ( struct net_device *trunk, unsigned int tag ) {
214 215
  * @v trunk		Trunk network device
215 216
  * @v ll_dest		Link-layer destination address
216 217
  * @v ll_source		Link-layer source address
218
+ * @v flags		Packet flags
217 219
  * @ret rc		Return status code
218 220
  */
219 221
 static int vlan_rx ( struct io_buffer *iobuf, struct net_device *trunk,
220
-		     const void *ll_dest, const void *ll_source ) {
222
+		     const void *ll_dest, const void *ll_source,
223
+		     unsigned int flags __unused ) {
221 224
 	struct vlan_header *vlanhdr = iobuf->data;
222 225
 	struct net_device *netdev;
223 226
 	struct ll_protocol *ll_protocol;

+ 6
- 2
src/usr/lotest.c Vedi File

@@ -47,12 +47,14 @@ FILE_LICENCE ( GPL2_OR_LATER );
47 47
  * @v netdev		Network device
48 48
  * @v ll_dest		Link-layer destination address
49 49
  * @v ll_source		Link-layer source address
50
+ * @v flags		Packet flags
50 51
  * @ret rc		Return status code
51 52
  */
52 53
 static int lotest_rx ( struct io_buffer *iobuf,
53 54
 		       struct net_device *netdev __unused,
54 55
 		       const void *ll_dest __unused,
55
-		       const void *ll_source __unused ) {
56
+		       const void *ll_source __unused,
57
+		       unsigned int flags __unused ) {
56 58
 	free_iob ( iobuf );
57 59
 	return -ENOTSUP;
58 60
 }
@@ -97,6 +99,7 @@ int loopback_test ( struct net_device *sender, struct net_device *receiver,
97 99
 	const void *ll_dest;
98 100
 	const void *ll_source;
99 101
 	uint16_t net_proto;
102
+	unsigned int flags;
100 103
 	unsigned int i;
101 104
 	unsigned int successes;
102 105
 	int rc;
@@ -166,7 +169,8 @@ int loopback_test ( struct net_device *sender, struct net_device *receiver,
166 169
 		/* Check received packet */
167 170
 		if ( ( rc = receiver->ll_protocol->pull ( receiver, iobuf,
168 171
 							  &ll_dest, &ll_source,
169
-							  &net_proto ) ) != 0 ){
172
+							  &net_proto,
173
+							  &flags ) ) != 0 ) {
170 174
 			printf ( "\nFailed to strip link-layer header: %s",
171 175
 				 strerror ( rc ) );
172 176
 			goto done;

Loading…
Annulla
Salva