Merge ~paelzer/ubuntu/+source/ipxe:fix-lp1805920-vlan0-tag-stripping-cosmic into ubuntu/+source/ipxe:ubuntu/cosmic-devel

Proposed by Christian Ehrhardt 
Status: Merged
Merge reported by: Christian Ehrhardt 
Merged at revision: cc3c947c36402576d33e118a7b37a70f4758edf2
Proposed branch: ~paelzer/ubuntu/+source/ipxe:fix-lp1805920-vlan0-tag-stripping-cosmic
Merge into: ubuntu/+source/ipxe:ubuntu/cosmic-devel
Diff against target: 157 lines (+135/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/0005-strip-802.1Q-VLAN-0-priority-tags.patch (+127/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Andreas Hasenack Approve
Andres Rodriguez Pending
Canonical Server Pending
git-ubuntu developers Pending
Review via email: mp+360678@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I see the bug is still marked as incomplete, and pending a test case, but that doesn't block review.

The DEP3 header is lacking Last-Update, and maybe a link to the upstream commit? The centos commit hints that upstream sent a patch (or a patch was sent upstream), but it's the same person (Ladi?). The ubuntu bug says that upstream didn't "follow the suggestion", is there a link to some discussion, upstream bug, or mailing list post? The mailing list link in the centos patch has just one post, no thread that followed.

For the actual upload, I think only a test case is missing in the SRU template, if that's even doable. This may require a somewhat complex setup to test.

I'll mark as needs info just because of the questions above.

Revision history for this message
Andreas Hasenack (ahasenack) :
review: Needs Information
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

It was not Nacked, the only follow up was http://lists.ipxe.org/pipermail/ipxe-devel/2016-August/005144.html later on.

I added the links, the date and a short statement about it to the header.
Pushing in a few minutes.

cc3c947... by Christian Ehrhardt 

d/p/0005-strip-802.1Q-VLAN-0-priority-tags.patch: improve dep8 header

Signed-off-by: Christian Ehrhardt <email address hidden>

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

+1, but it's a dep3 header, not dep8 ;)

review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

In SRU proposed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index beee4bb..bfb5e6b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+ipxe (1.0.0+git-20180124.fbe8c52d-0ubuntu4.1) cosmic; urgency=medium
7+
8+ * d/p/0005-strip-802.1Q-VLAN-0-priority-tags.patch: Strip 802.1Q VLAN 0
9+ priority tags; Fixes PXE when VLAN tag is 0. (LP: #1805920)
10+
11+ -- Andres Rodriguez <andreserl@ubuntu.com> Mon, 10 Dec 2018 16:26:42 -0500
12+
13 ipxe (1.0.0+git-20180124.fbe8c52d-0ubuntu4) cosmic; urgency=medium
14
15 * Build ROMs for QEMU with CONFIG=qemu (LP: #1789319)
16diff --git a/debian/patches/0005-strip-802.1Q-VLAN-0-priority-tags.patch b/debian/patches/0005-strip-802.1Q-VLAN-0-priority-tags.patch
17new file mode 100644
18index 0000000..b39fdc1
19--- /dev/null
20+++ b/debian/patches/0005-strip-802.1Q-VLAN-0-priority-tags.patch
21@@ -0,0 +1,127 @@
22+From: Ladi Prosek <lprosek@redhat.com>
23+Subject: Strip 802.1Q VLAN 0 priority tags
24+ iPXE was unable to receive priority tagged packets specified in
25+ the 802.1Q standard and supported by all major networking stacks.
26+ .
27+ This commit adds a new function net_pull_tags which is called by
28+ all consumers of incoming packets after stripping their link-layer
29+ headers.
30+ .
31+ This was tried to be upstreamed in
32+ http://lists.ipxe.org/pipermail/ipxe-devel/2016-July/005099.html but not
33+ accepted by upstream (no Nack, just ignored).
34+ .
35+Origin: vendor, https://git.centos.org/blob/rpms!ipxe.git/c7/SOURCES!0009-Strip-802.1Q-VLAN-0-priority-tags.patch
36+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1805920
37+Last-Update: 2018-12-14
38+
39+Index: ipxe-1.0.0+git-20180124.fbe8c52d/src/arch/x86/interface/pxe/pxe_undi.c
40+===================================================================
41+--- ipxe-1.0.0+git-20180124.fbe8c52d.orig/src/arch/x86/interface/pxe/pxe_undi.c 2018-11-30 22:42:34.000000000 -0500
42++++ ipxe-1.0.0+git-20180124.fbe8c52d/src/arch/x86/interface/pxe/pxe_undi.c 2018-11-30 22:54:25.000000000 -0500
43+@@ -976,6 +976,12 @@
44+ }
45+ ll_hlen = ( len - iob_len ( iobuf ) );
46+
47++ /* Strip link-layer-independent headers */
48++ if ( ( rc = net_pull_tags ( iobuf, pxe_netdev, &net_proto ) ) != 0 ) {
49++ /* Assume unknown net_proto */
50++ net_proto = 0;
51++ }
52++
53+ /* Determine network-layer protocol */
54+ switch ( net_proto ) {
55+ case htons ( ETH_P_IP ):
56+Index: ipxe-1.0.0+git-20180124.fbe8c52d/src/include/ipxe/netdevice.h
57+===================================================================
58+--- ipxe-1.0.0+git-20180124.fbe8c52d.orig/src/include/ipxe/netdevice.h 2018-11-30 22:42:34.000000000 -0500
59++++ ipxe-1.0.0+git-20180124.fbe8c52d/src/include/ipxe/netdevice.h 2018-11-30 22:54:25.000000000 -0500
60+@@ -726,6 +726,8 @@
61+ extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
62+ uint16_t net_proto, const void *ll_dest,
63+ const void *ll_source, unsigned int flags );
64++extern int net_pull_tags ( struct io_buffer *iobuf, struct net_device *netdev,
65++ uint16_t *net_proto );
66+ extern void net_poll ( void );
67+ extern struct net_device_configurator *
68+ find_netdev_configurator ( const char *name );
69+Index: ipxe-1.0.0+git-20180124.fbe8c52d/src/interface/efi/efi_snp.c
70+===================================================================
71+--- ipxe-1.0.0+git-20180124.fbe8c52d.orig/src/interface/efi/efi_snp.c 2018-11-30 22:42:34.000000000 -0500
72++++ ipxe-1.0.0+git-20180124.fbe8c52d/src/interface/efi/efi_snp.c 2018-11-30 22:54:25.000000000 -0500
73+@@ -751,6 +751,13 @@
74+ goto out_bad_ll_header;
75+ }
76+
77++ /* Strip link-layer-independent headers */
78++ if ( ( rc = net_pull_tags ( iobuf, snpdev->netdev, &iob_net_proto ) ) ) {
79++ DBGC ( snpdev, "SNPDEV %p could not parse tags: %s\n",
80++ snpdev, strerror ( rc ) );
81++ goto out_bad_ll_header;
82++ }
83++
84+ /* Return link-layer header parameters to caller, if required */
85+ if ( ll_header_len )
86+ *ll_header_len = ll_protocol->ll_header_len;
87+Index: ipxe-1.0.0+git-20180124.fbe8c52d/src/net/netdevice.c
88+===================================================================
89+--- ipxe-1.0.0+git-20180124.fbe8c52d.orig/src/net/netdevice.c 2018-11-30 22:42:34.000000000 -0500
90++++ ipxe-1.0.0+git-20180124.fbe8c52d/src/net/netdevice.c 2018-11-30 22:54:25.000000000 -0500
91+@@ -1044,6 +1044,44 @@
92+ }
93+
94+ /**
95++ * Strip extra link-layer-independent tags from a received packet
96++ *
97++ * @v iobuf I/O buffer
98++ * @v netdev Network device
99++ * @v net_proto Network-layer protocol, in network-byte order
100++ * @ret rc Return status code
101++ *
102++ * This function should be called after stripping link-layer headers but
103++ * before inspecting the network-layer protocol.
104++ */
105++int net_pull_tags ( struct io_buffer *iobuf, struct net_device *netdev,
106++ uint16_t *net_proto ) {
107++ struct vlan_header *vlanhdr;
108++ uint16_t tag;
109++
110++ /* Strip 802.1Q VLAN 0 priority tags if present */
111++ while ( *net_proto == htons ( ETH_P_8021Q ) ) {
112++ if ( iob_len ( iobuf ) < sizeof ( *vlanhdr ) ) {
113++ DBG ( "VLAN header too short at %zd bytes (min %zd bytes)\n",
114++ iob_len ( iobuf ), sizeof ( *vlanhdr ) );
115++ return -EINVAL;
116++ }
117++ vlanhdr = ( struct vlan_header * ) iobuf->data;
118++ tag = VLAN_TAG ( ntohs ( vlanhdr->tci ) );
119++
120++ if ( tag == 0 && ! vlan_find ( netdev, tag ) ) {
121++ /* VLAN 0, strip and continue */
122++ *net_proto = vlanhdr->net_proto;
123++ iob_pull ( iobuf, sizeof ( *vlanhdr ) );
124++ } else {
125++ /* Real VLAN tag, leave it alone */
126++ break;
127++ }
128++ }
129++ return 0;
130++}
131++
132++/**
133+ * Poll the network stack
134+ *
135+ * This polls all interfaces for received packets, and processes
136+@@ -1093,6 +1131,12 @@
137+ free_iob ( iobuf );
138+ continue;
139+ }
140++
141++ /* Remove link-layer-independent headers */
142++ if ( ( rc = net_pull_tags ( iobuf, netdev, &net_proto ) ) ) {
143++ free_iob ( iobuf );
144++ continue;
145++ }
146+
147+ /* Hand packet to network layer */
148+ if ( ( rc = net_rx ( iob_disown ( iobuf ), netdev,
149diff --git a/debian/patches/series b/debian/patches/series
150index 6d8351b..db818d1 100644
151--- a/debian/patches/series
152+++ b/debian/patches/series
153@@ -3,3 +3,4 @@ util-elf2efi-GNU_SOURCE.patch
154 enable-https.patch
155 handle-dhcp-nack.patch
156 fix-elf2efi-plt-relocation.diff
157+0005-strip-802.1Q-VLAN-0-priority-tags.patch

Subscribers

People subscribed via source and target branches