Bug 196646 - r276149 breaks gif with if_bridge and EtherIP
Summary: r276149 breaks gif with if_bridge and EtherIP
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Andrey V. Elsukov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-12 18:31 UTC by John Nielsen
Modified: 2015-01-17 11:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Nielsen 2015-01-12 18:31:01 UTC
I discovered this under 10-STABLE but it probably affects 11-CURRENT (after
r273087) as well.

I've been using a gif(4) Ethernet (EtherIP/if_bridge) tunnel between two
10-STABLE FreeBSD machines for a while with no problem. After updating both
sides on 2014-12-30 the tunnel stopped working.

Today I reverted r276149 (the MFC of the if_gif overhaul) from my source tree
and rebuilt the kernel. The tunnel works again.

I'm sure the if_gif overhaul was needed but it would be great to get the
EtherIP functionality restored.

Both ends of the tunnel are running: 10.1-STABLE FreeBSD 10.1-STABLE #2
r276732M [minus r276149]: Fri Jan  9 11:16:55 MST 2015

I'm happy to test patches.

Environment:
FreeBSD 10.1-STABLE
Comment 1 Gavin Atkinson freebsd_committer freebsd_triage 2015-01-12 18:49:02 UTC
Hi,

Due to an issue with the backend FreeBSD Bugzilla database, your original PR and any updates to it since have been lost.  I've recreated the original PR as best as I can, however any attachments and updates you submitted to the PR have been lost.  Please could you resubmit them?

Thanks, and apologies.
Comment 2 John Nielsen 2015-01-12 19:22:24 UTC
The comment describing my use case was lost. Basically I configure only the outer tunnel of the gif interface and then add it to a bridge, so EtherIP is sent over the inner tunnel. Useful for e.g. bridging two Ethernet segments connected by a non-Ethernet link (802.11 in infrastructure mode, IPoIB, etc).

This has been fixed in head by commit r276907 and I confirmed that the same patch fixes the issue in 10-STABLE. Thanks ae!

My suggestion would be to leave the ticket open as a reminder to MFC the relevant changes next week.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-01-17 11:43:48 UTC
A commit references this bug:

Author: ae
Date: Sat Jan 17 11:43:14 UTC 2015
New revision: 277297
URL: https://svnweb.freebsd.org/changeset/base/277297

Log:
  MFC r276901:
    Move the recursion detection code into separate function
    gif_check_nesting(). Also make MTAG_GIF definition private to if_gif.c.

  MFC r276907:
    Restore Ethernet-within-IP Encapsulation support that was broken after
    r273087. Move all checks from gif_output() into gif_transmit(). Previously
    they were checked always, because if_start always called gif_output.
    Now gif_transmit() can be called directly from if_bridge() code and we need
    do checks here.

    PR:		196646

Changes:
_U  stable/10/
  stable/10/sys/net/if_gif.c
  stable/10/sys/net/if_gif.h
Comment 4 Andrey V. Elsukov freebsd_committer freebsd_triage 2015-01-17 11:44:37 UTC
Fixed in r277297.