Browse Source

[netdevice] Pass both link-layer addresses in net_tx() and net_rx()

FCoE requires the use of fabric-provided MAC addresses, which breaks
the assumption that the net device's MAC address is implicitly the
source address for net_tx() and the (unicast) destination address for
net_rx().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
88dd921e24

+ 3
- 2
src/include/ipxe/eapol.h View File

90
 	 *
90
 	 *
91
 	 * @v iob	I/O buffer containing packet payload
91
 	 * @v iob	I/O buffer containing packet payload
92
 	 * @v netdev	Network device from which packet was received
92
 	 * @v netdev	Network device from which packet was received
93
-	 * @v ll_source	Source link-layer address from which packet was received
93
+	 * @V ll_dest	Destination link-layer address
94
+	 * @v ll_source	Source link-layer address
94
 	 * @ret rc	Return status code
95
 	 * @ret rc	Return status code
95
 	 *
96
 	 *
96
 	 * The I/O buffer will have the EAPOL header pulled off it, so
97
 	 * The I/O buffer will have the EAPOL header pulled off it, so
99
 	 * This function takes ownership of the I/O buffer passed to it.
100
 	 * This function takes ownership of the I/O buffer passed to it.
100
 	 */
101
 	 */
101
 	int ( * rx ) ( struct io_buffer *iob, struct net_device *netdev,
102
 	int ( * rx ) ( struct io_buffer *iob, struct net_device *netdev,
102
-		       const void *ll_source );
103
+		       const void *ll_dest, const void *ll_source );
103
 };
104
 };
104
 
105
 
105
 #define EAPOL_HANDLERS	__table ( struct eapol_handler, "eapol_handlers" )
106
 #define EAPOL_HANDLERS	__table ( struct eapol_handler, "eapol_handlers" )

+ 6
- 3
src/include/ipxe/netdevice.h View File

57
 	 *
57
 	 *
58
 	 * @v iobuf	I/O buffer
58
 	 * @v iobuf	I/O buffer
59
 	 * @v netdev	Network device
59
 	 * @v netdev	Network device
60
+	 * @v ll_dest	Link-layer destination address
60
 	 * @v ll_source	Link-layer source address
61
 	 * @v ll_source	Link-layer source address
61
 	 *
62
 	 *
62
 	 * This method takes ownership of the I/O buffer.
63
 	 * This method takes ownership of the I/O buffer.
63
 	 */
64
 	 */
64
 	int ( * rx ) ( struct io_buffer *iobuf, struct net_device *netdev,
65
 	int ( * rx ) ( struct io_buffer *iobuf, struct net_device *netdev,
65
-		       const void *ll_source );
66
+		       const void *ll_dest, const void *ll_source );
66
 	/**
67
 	/**
67
 	 * Transcribe network-layer address
68
 	 * Transcribe network-layer address
68
 	 *
69
 	 *
534
 						     unsigned int location );
535
 						     unsigned int location );
535
 extern struct net_device * last_opened_netdev ( void );
536
 extern struct net_device * last_opened_netdev ( void );
536
 extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
537
 extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
537
-		    struct net_protocol *net_protocol, const void *ll_dest );
538
+		    struct net_protocol *net_protocol, const void *ll_dest,
539
+		    const void *ll_source );
538
 extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
540
 extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
539
-		    uint16_t net_proto, const void *ll_source );
541
+		    uint16_t net_proto, const void *ll_dest,
542
+		    const void *ll_source );
540
 
543
 
541
 /**
544
 /**
542
  * Complete network transmission
545
  * Complete network transmission

+ 3
- 1
src/net/80211/wpa.c View File

455
 			   pkt->mic );
455
 			   pkt->mic );
456
 
456
 
457
 	return net_tx ( iob, ctx->dev->netdev, &eapol_protocol,
457
 	return net_tx ( iob, ctx->dev->netdev, &eapol_protocol,
458
-			ctx->dev->bssid );
458
+			ctx->dev->bssid, ctx->dev->netdev->ll_addr );
459
 }
459
 }
460
 
460
 
461
 
461
 
757
  *
757
  *
758
  * @v iob	I/O buffer
758
  * @v iob	I/O buffer
759
  * @v netdev	Network device
759
  * @v netdev	Network device
760
+ * @v ll_dest	Link-layer destination address
760
  * @v ll_source	Source link-layer address
761
  * @v ll_source	Source link-layer address
761
  */
762
  */
762
 static int eapol_key_rx ( struct io_buffer *iob, struct net_device *netdev,
763
 static int eapol_key_rx ( struct io_buffer *iob, struct net_device *netdev,
764
+			  const void *ll_dest __unused,
763
 			  const void *ll_source )
765
 			  const void *ll_source )
764
 {
766
 {
765
 	struct net80211_device *dev = net80211_get ( netdev );
767
 	struct net80211_device *dev = net80211_get ( netdev );

+ 6
- 3
src/net/aoe.c View File

249
  */
249
  */
250
 static int aoecmd_tx ( struct aoe_command *aoecmd ) {
250
 static int aoecmd_tx ( struct aoe_command *aoecmd ) {
251
 	struct aoe_device *aoedev = aoecmd->aoedev;
251
 	struct aoe_device *aoedev = aoecmd->aoedev;
252
+	struct net_device *netdev = aoedev->netdev;
252
 	struct io_buffer *iobuf;
253
 	struct io_buffer *iobuf;
253
 	struct aoehdr *aoehdr;
254
 	struct aoehdr *aoehdr;
254
 	size_t cmd_len;
255
 	size_t cmd_len;
255
 	int rc;
256
 	int rc;
256
 
257
 
257
 	/* Sanity check */
258
 	/* Sanity check */
258
-	assert ( aoedev->netdev != NULL );
259
+	assert ( netdev != NULL );
259
 
260
 
260
 	/* If we are transmitting anything that requires a response,
261
 	/* If we are transmitting anything that requires a response,
261
          * start the retransmission timer.  Do this before attempting
262
          * start the retransmission timer.  Do this before attempting
281
 	aoecmd->type->cmd ( aoecmd, iobuf->data, iob_len ( iobuf ) );
282
 	aoecmd->type->cmd ( aoecmd, iobuf->data, iob_len ( iobuf ) );
282
 
283
 
283
 	/* Send packet */
284
 	/* Send packet */
284
-	if ( ( rc = net_tx ( iobuf, aoedev->netdev, &aoe_protocol,
285
-			     aoedev->target ) ) != 0 ) {
285
+	if ( ( rc = net_tx ( iobuf, netdev, &aoe_protocol, aoedev->target,
286
+			     netdev->ll_addr ) ) != 0 ) {
286
 		DBGC ( aoedev, "AoE %s/%08x could not transmit: %s\n",
287
 		DBGC ( aoedev, "AoE %s/%08x could not transmit: %s\n",
287
 		       aoedev_name ( aoedev ), aoecmd->tag,
288
 		       aoedev_name ( aoedev ), aoecmd->tag,
288
 		       strerror ( rc ) );
289
 		       strerror ( rc ) );
903
  *
904
  *
904
  * @v iobuf		I/O buffer
905
  * @v iobuf		I/O buffer
905
  * @v netdev		Network device
906
  * @v netdev		Network device
907
+ * @v ll_dest		Link-layer destination address
906
  * @v ll_source		Link-layer source address
908
  * @v ll_source		Link-layer source address
907
  * @ret rc		Return status code
909
  * @ret rc		Return status code
908
  *
910
  *
909
  */
911
  */
910
 static int aoe_rx ( struct io_buffer *iobuf,
912
 static int aoe_rx ( struct io_buffer *iobuf,
911
 		    struct net_device *netdev __unused,
913
 		    struct net_device *netdev __unused,
914
+		    const void *ll_dest __unused,
912
 		    const void *ll_source ) {
915
 		    const void *ll_source ) {
913
 	struct aoehdr *aoehdr = iobuf->data;
916
 	struct aoehdr *aoehdr = iobuf->data;
914
 	struct aoe_command *aoecmd;
917
 	struct aoe_command *aoecmd;

+ 4
- 3
src/net/arp.c View File

155
 		 dest_net_addr, net_protocol->net_addr_len );
155
 		 dest_net_addr, net_protocol->net_addr_len );
156
 
156
 
157
 	/* Transmit ARP request */
157
 	/* Transmit ARP request */
158
-	if ( ( rc = net_tx ( iobuf, netdev, &arp_protocol, 
159
-			     netdev->ll_broadcast ) ) != 0 )
158
+	if ( ( rc = net_tx ( iobuf, netdev, &arp_protocol,
159
+			     netdev->ll_broadcast, netdev->ll_addr ) ) != 0 )
160
 		return rc;
160
 		return rc;
161
 
161
 
162
 	return -ENOENT;
162
 	return -ENOENT;
195
  * details.
195
  * details.
196
  */
196
  */
197
 static int arp_rx ( struct io_buffer *iobuf, struct net_device *netdev,
197
 static int arp_rx ( struct io_buffer *iobuf, struct net_device *netdev,
198
+		    const void *ll_dest __unused,
198
 		    const void *ll_source __unused ) {
199
 		    const void *ll_source __unused ) {
199
 	struct arphdr *arphdr = iobuf->data;
200
 	struct arphdr *arphdr = iobuf->data;
200
 	struct arp_net_protocol *arp_net_protocol;
201
 	struct arp_net_protocol *arp_net_protocol;
261
 
262
 
262
 	/* Send reply */
263
 	/* Send reply */
263
 	net_tx ( iob_disown ( iobuf ), netdev, &arp_protocol,
264
 	net_tx ( iob_disown ( iobuf ), netdev, &arp_protocol,
264
-		 arp_target_ha ( arphdr ) );
265
+		 arp_target_ha ( arphdr ), netdev->ll_addr );
265
 
266
 
266
  done:
267
  done:
267
 	free_iob ( iobuf );
268
 	free_iob ( iobuf );

+ 3
- 3
src/net/eapol.c View File

36
  *
36
  *
37
  * @v iob	I/O buffer
37
  * @v iob	I/O buffer
38
  * @v netdev	Network device
38
  * @v netdev	Network device
39
+ * @v ll_dest	Link-layer destination address
39
  * @v ll_source	Link-layer source address
40
  * @v ll_source	Link-layer source address
40
  *
41
  *
41
  * This function takes ownership of the I/O buffer passed to it.
42
  * This function takes ownership of the I/O buffer passed to it.
42
  */
43
  */
43
 static int eapol_rx ( struct io_buffer *iob, struct net_device *netdev,
44
 static int eapol_rx ( struct io_buffer *iob, struct net_device *netdev,
44
-		      const void *ll_source )
45
-{
45
+		      const void *ll_dest, const void *ll_source ) {
46
 	struct eapol_frame *eapol = iob->data;
46
 	struct eapol_frame *eapol = iob->data;
47
 	struct eapol_handler *handler;
47
 	struct eapol_handler *handler;
48
 
48
 
54
 	for_each_table_entry ( handler, EAPOL_HANDLERS ) {
54
 	for_each_table_entry ( handler, EAPOL_HANDLERS ) {
55
 		if ( handler->type == eapol->type ) {
55
 		if ( handler->type == eapol->type ) {
56
 			iob_pull ( iob, EAPOL_HDR_LEN );
56
 			iob_pull ( iob, EAPOL_HDR_LEN );
57
-			return handler->rx ( iob, netdev, ll_source );
57
+			return handler->rx ( iob, netdev, ll_dest, ll_source );
58
 		}
58
 		}
59
 	}
59
 	}
60
 
60
 

+ 5
- 2
src/net/eth_slow.c View File

174
 
174
 
175
 	/* Send response */
175
 	/* Send response */
176
 	eth_slow_lacp_dump ( iobuf, netdev, "TX" );
176
 	eth_slow_lacp_dump ( iobuf, netdev, "TX" );
177
-	return net_tx ( iobuf, netdev, &eth_slow_protocol, eth_slow_address );
177
+	return net_tx ( iobuf, netdev, &eth_slow_protocol, eth_slow_address,
178
+			netdev->ll_addr );
178
 }
179
 }
179
 
180
 
180
 /**
181
 /**
218
 		marker->marker.tlv.type = ETH_SLOW_TLV_MARKER_RESPONSE;
219
 		marker->marker.tlv.type = ETH_SLOW_TLV_MARKER_RESPONSE;
219
 		eth_slow_marker_dump ( iobuf, netdev, "TX" );
220
 		eth_slow_marker_dump ( iobuf, netdev, "TX" );
220
 		return net_tx ( iobuf, netdev, &eth_slow_protocol,
221
 		return net_tx ( iobuf, netdev, &eth_slow_protocol,
221
-				eth_slow_address );
222
+				eth_slow_address, netdev->ll_addr );
222
 	} else {
223
 	} else {
223
 		/* Discard all other marker packets */
224
 		/* Discard all other marker packets */
224
 		free_iob ( iobuf );
225
 		free_iob ( iobuf );
231
  *
232
  *
232
  * @v iobuf		I/O buffer
233
  * @v iobuf		I/O buffer
233
  * @v netdev		Network device
234
  * @v netdev		Network device
235
+ * @v ll_dest		Link-layer destination address
234
  * @v ll_source		Link-layer source address
236
  * @v ll_source		Link-layer source address
235
  * @ret rc		Return status code
237
  * @ret rc		Return status code
236
  */
238
  */
237
 static int eth_slow_rx ( struct io_buffer *iobuf,
239
 static int eth_slow_rx ( struct io_buffer *iobuf,
238
 			 struct net_device *netdev,
240
 			 struct net_device *netdev,
241
+			 const void *ll_dest __unused,
239
 			 const void *ll_source __unused ) {
242
 			 const void *ll_source __unused ) {
240
 	union eth_slow_packet *eth_slow = iobuf->data;
243
 	union eth_slow_packet *eth_slow = iobuf->data;
241
 
244
 

+ 4
- 4
src/net/fcoe.c View File

129
 
129
 
130
 	/* Transmit packet */
130
 	/* Transmit packet */
131
 	if ( ( rc = net_tx ( iob_disown ( iobuf ), fcoe->netdev, &fcoe_protocol,
131
 	if ( ( rc = net_tx ( iob_disown ( iobuf ), fcoe->netdev, &fcoe_protocol,
132
-			     fcoe->fcf_ll_addr ) ) != 0 ) {
132
+			     fcoe->fcf_ll_addr, fcoe->netdev->ll_addr )) != 0){
133
 		DBGC ( fcoe, "FCoE %s could not transmit: %s\n",
133
 		DBGC ( fcoe, "FCoE %s could not transmit: %s\n",
134
 		       fcoe->netdev->name, strerror ( rc ) );
134
 		       fcoe->netdev->name, strerror ( rc ) );
135
 		goto done;
135
 		goto done;
164
  *
164
  *
165
  * @v iobuf		I/O buffer
165
  * @v iobuf		I/O buffer
166
  * @v netdev		Network device
166
  * @v netdev		Network device
167
+ * @v ll_dest		Link-layer destination address
167
  * @v ll_source		Link-layer source address
168
  * @v ll_source		Link-layer source address
168
  * @ret rc		Return status code
169
  * @ret rc		Return status code
169
  */
170
  */
170
-static int fcoe_rx ( struct io_buffer *iobuf,
171
-		     struct net_device *netdev,
172
-		     const void *ll_source ) {
171
+static int fcoe_rx ( struct io_buffer *iobuf, struct net_device *netdev,
172
+		     const void *ll_dest __unused, const void *ll_source ) {
173
 	struct fcoe_header *fcoehdr;
173
 	struct fcoe_header *fcoehdr;
174
 	struct fcoe_footer *fcoeftr;
174
 	struct fcoe_footer *fcoeftr;
175
 	struct fcoe_port *fcoe;
175
 	struct fcoe_port *fcoe;

+ 6
- 2
src/net/ipv4.c View File

355
 	      ntohs ( iphdr->ident ), ntohs ( iphdr->chksum ) );
355
 	      ntohs ( iphdr->ident ), ntohs ( iphdr->chksum ) );
356
 
356
 
357
 	/* Hand off to link layer */
357
 	/* Hand off to link layer */
358
-	if ( ( rc = net_tx ( iobuf, netdev, &ipv4_protocol, ll_dest ) ) != 0 ) {
358
+	if ( ( rc = net_tx ( iobuf, netdev, &ipv4_protocol, ll_dest,
359
+			     netdev->ll_addr ) ) != 0 ) {
359
 		DBG ( "IPv4 could not transmit packet via %s: %s\n",
360
 		DBG ( "IPv4 could not transmit packet via %s: %s\n",
360
 		      netdev->name, strerror ( rc ) );
361
 		      netdev->name, strerror ( rc ) );
361
 		return rc;
362
 		return rc;
373
  *
374
  *
374
  * @v iobuf	I/O buffer
375
  * @v iobuf	I/O buffer
375
  * @v netdev	Network device
376
  * @v netdev	Network device
377
+ * @v ll_dest	Link-layer destination address
376
  * @v ll_source	Link-layer destination source
378
  * @v ll_source	Link-layer destination source
377
  *
379
  *
378
  * This function expects an IP4 network datagram. It processes the headers 
380
  * This function expects an IP4 network datagram. It processes the headers 
379
  * and sends it to the transport layer.
381
  * and sends it to the transport layer.
380
  */
382
  */
381
-static int ipv4_rx ( struct io_buffer *iobuf, struct net_device *netdev __unused,
383
+static int ipv4_rx ( struct io_buffer *iobuf,
384
+		     struct net_device *netdev __unused,
385
+		     const void *ll_dest __unused,
382
 		     const void *ll_source __unused ) {
386
 		     const void *ll_source __unused ) {
383
 	struct iphdr *iphdr = iobuf->data;
387
 	struct iphdr *iphdr = iobuf->data;
384
 	size_t hdrlen;
388
 	size_t hdrlen;

+ 4
- 1
src/net/ipv6.c View File

242
 	}
242
 	}
243
 
243
 
244
 	/* Transmit packet */
244
 	/* Transmit packet */
245
-	return net_tx ( iobuf, netdev, &ipv6_protocol, ll_dest );
245
+	return net_tx ( iobuf, netdev, &ipv6_protocol, ll_dest,
246
+			netdev->ll_addr );
246
 
247
 
247
   err:
248
   err:
248
 	free_iob ( iobuf );
249
 	free_iob ( iobuf );
285
  *
286
  *
286
  * @v iobuf		I/O buffer
287
  * @v iobuf		I/O buffer
287
  * @v netdev		Network device
288
  * @v netdev		Network device
289
+ * @v ll_dest		Link-layer destination address
288
  * @v ll_source		Link-layer source address
290
  * @v ll_source		Link-layer source address
289
  *
291
  *
290
  * This function processes a IPv6 packet
292
  * This function processes a IPv6 packet
291
  */
293
  */
292
 static int ipv6_rx ( struct io_buffer *iobuf,
294
 static int ipv6_rx ( struct io_buffer *iobuf,
293
 		     __unused struct net_device *netdev,
295
 		     __unused struct net_device *netdev,
296
+		     __unused const void *ll_dest,
294
 		     __unused const void *ll_source ) {
297
 		     __unused const void *ll_source ) {
295
 
298
 
296
 	struct ip6_header *ip6hdr = iobuf->data;
299
 	struct ip6_header *ip6hdr = iobuf->data;

+ 10
- 5
src/net/netdevice.c View File

607
  * @v netdev		Network device
607
  * @v netdev		Network device
608
  * @v net_protocol	Network-layer protocol
608
  * @v net_protocol	Network-layer protocol
609
  * @v ll_dest		Destination link-layer address
609
  * @v ll_dest		Destination link-layer address
610
+ * @v ll_source		Source link-layer address
610
  * @ret rc		Return status code
611
  * @ret rc		Return status code
611
  *
612
  *
612
  * Prepends link-layer headers to the I/O buffer and transmits the
613
  * Prepends link-layer headers to the I/O buffer and transmits the
614
  * ownership of the I/O buffer.
615
  * ownership of the I/O buffer.
615
  */
616
  */
616
 int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
617
 int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
617
-	     struct net_protocol *net_protocol, const void *ll_dest ) {
618
+	     struct net_protocol *net_protocol, const void *ll_dest,
619
+	     const void *ll_source ) {
618
 	struct ll_protocol *ll_protocol = netdev->ll_protocol;
620
 	struct ll_protocol *ll_protocol = netdev->ll_protocol;
619
 	int rc;
621
 	int rc;
620
 
622
 
626
 	netdev_poll ( netdev );
628
 	netdev_poll ( netdev );
627
 
629
 
628
 	/* Add link-layer header */
630
 	/* Add link-layer header */
629
-	if ( ( rc = ll_protocol->push ( netdev, iobuf, ll_dest, netdev->ll_addr,
631
+	if ( ( rc = ll_protocol->push ( netdev, iobuf, ll_dest, ll_source,
630
 					net_protocol->net_proto ) ) != 0 ) {
632
 					net_protocol->net_proto ) ) != 0 ) {
631
 		free_iob ( iobuf );
633
 		free_iob ( iobuf );
632
 		return rc;
634
 		return rc;
642
  * @v iobuf		I/O buffer
644
  * @v iobuf		I/O buffer
643
  * @v netdev		Network device
645
  * @v netdev		Network device
644
  * @v net_proto		Network-layer protocol, in network-byte order
646
  * @v net_proto		Network-layer protocol, in network-byte order
647
+ * @v ll_dest		Destination link-layer address
645
  * @v ll_source		Source link-layer address
648
  * @v ll_source		Source link-layer address
646
  * @ret rc		Return status code
649
  * @ret rc		Return status code
647
  */
650
  */
648
 int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
651
 int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
649
-	     uint16_t net_proto, const void *ll_source ) {
652
+	     uint16_t net_proto, const void *ll_dest, const void *ll_source ) {
650
 	struct net_protocol *net_protocol;
653
 	struct net_protocol *net_protocol;
651
 
654
 
652
 	/* Hand off to network-layer protocol, if any */
655
 	/* Hand off to network-layer protocol, if any */
653
 	for_each_table_entry ( net_protocol, NET_PROTOCOLS ) {
656
 	for_each_table_entry ( net_protocol, NET_PROTOCOLS ) {
654
 		if ( net_protocol->net_proto == net_proto )
657
 		if ( net_protocol->net_proto == net_proto )
655
-			return net_protocol->rx ( iobuf, netdev, ll_source );
658
+			return net_protocol->rx ( iobuf, netdev, ll_dest,
659
+						  ll_source );
656
 	}
660
 	}
657
 
661
 
658
 	DBGC ( netdev, "NETDEV %p unknown network protocol %04x\n",
662
 	DBGC ( netdev, "NETDEV %p unknown network protocol %04x\n",
707
 
711
 
708
 			/* Hand packet to network layer */
712
 			/* Hand packet to network layer */
709
 			if ( ( rc = net_rx ( iob_disown ( iobuf ), netdev,
713
 			if ( ( rc = net_rx ( iob_disown ( iobuf ), netdev,
710
-					     net_proto, ll_source ) ) != 0 ) {
714
+					     net_proto, ll_dest,
715
+					     ll_source ) ) != 0 ) {
711
 				/* Record error for diagnosis */
716
 				/* Record error for diagnosis */
712
 				netdev_rx_err ( netdev, NULL, rc );
717
 				netdev_rx_err ( netdev, NULL, rc );
713
 			}
718
 			}

+ 2
- 0
src/net/rarp.c View File

36
  *
36
  *
37
  * @v iobuf		I/O buffer
37
  * @v iobuf		I/O buffer
38
  * @v netdev		Network device
38
  * @v netdev		Network device
39
+ * @v ll_dest		Link-layer destination address
39
  * @v ll_source		Link-layer source address
40
  * @v ll_source		Link-layer source address
40
  * @ret rc		Return status code
41
  * @ret rc		Return status code
41
  *
42
  *
43
  */
44
  */
44
 static int rarp_rx ( struct io_buffer *iobuf,
45
 static int rarp_rx ( struct io_buffer *iobuf,
45
 		     struct net_device *netdev __unused,
46
 		     struct net_device *netdev __unused,
47
+		     const void *ll_dest __unused,
46
 		     const void *ll_source __unused ) {
48
 		     const void *ll_source __unused ) {
47
 	free_iob ( iobuf );
49
 	free_iob ( iobuf );
48
 	return 0;
50
 	return 0;

+ 4
- 2
src/usr/lotest.c View File

45
  *
45
  *
46
  * @v iobuf		I/O buffer
46
  * @v iobuf		I/O buffer
47
  * @v netdev		Network device
47
  * @v netdev		Network device
48
+ * @v ll_dest		Link-layer destination address
48
  * @v ll_source		Link-layer source address
49
  * @v ll_source		Link-layer source address
49
  * @ret rc		Return status code
50
  * @ret rc		Return status code
50
  */
51
  */
51
 static int lotest_rx ( struct io_buffer *iobuf,
52
 static int lotest_rx ( struct io_buffer *iobuf,
52
 		       struct net_device *netdev __unused,
53
 		       struct net_device *netdev __unused,
54
+		       const void *ll_dest __unused,
53
 		       const void *ll_source __unused ) {
55
 		       const void *ll_source __unused ) {
54
 	free_iob ( iobuf );
56
 	free_iob ( iobuf );
55
 	return -ENOTSUP;
57
 	return -ENOTSUP;
138
 
140
 
139
 		/* Transmit packet */
141
 		/* Transmit packet */
140
 		if ( ( rc = net_tx ( iob_disown ( iobuf ), sender,
142
 		if ( ( rc = net_tx ( iob_disown ( iobuf ), sender,
141
-				     &lotest_protocol,
142
-				     receiver->ll_addr ) ) != 0 ) {
143
+				     &lotest_protocol, receiver->ll_addr,
144
+				     sender->ll_addr ) ) != 0 ) {
143
 			printf ( "\nFailed to transmit packet: %s",
145
 			printf ( "\nFailed to transmit packet: %s",
144
 				 strerror ( rc ) );
146
 				 strerror ( rc ) );
145
 			goto done;
147
 			goto done;

Loading…
Cancel
Save