RUNNING flag remains unset upon reinserting a gre into VNET jail

John W. O'Brien john at saltant.com
Mon May 4 13:49:30 UTC 2020


On 2020/05/03 20:12, John W. O'Brien wrote:
> Hello Andrey and FreeBSD Net,
> 
> Today I stumbled upon what may be zero, one, or maybe two bugs. If it's
> one bug, then I think there might be a case the fine work in r339552 [0]
> to keep the RUNNING flag consistent with whether or not the gre source
> address exists does not accommodate. I'm still working on a minimal test
> case, so bear with me.
> 
> If I create gre0 on the host, then start a VNET jail which gets gre0 and
> a physical interface (msk1, in my case) and inside which both are
> configured, all is well inside the jail. Upon stopping the jail, the
> "tunnel" setting is not removed from the gre (I'm not sure whether to
> consider this a bug, too, or not), so when the dust settles back on the
> host, msk1 has no address, and the gre is not RUNNING, which is fine.
> However, if I start the jail again, then the gre is not RUNNING inside
> the jail even though msk1 again has the appropriate source address.
> 
> I worked around this by creating gre0 inside the jail where it is
> destroyed upon jail stop. It would be nice if it either worked the other
> way, or failed with less astonishment.
> 
> Am I missing something that should be obvious? If this does seem like a
> bug, shall I submit something now or wait until I have a cleaner demo?
> 
> [0] https://svnweb.freebsd.org/changeset/base/339552 (thank you!)

# create a jail, place an iface in it, then configure an address on it

jail -c name=demo vnet persist
ifconfig msk1 vnet demo
jexec demo ifconfig msk1 10.1.1.1/24

# create a gre outside the jail, configure its tunnel endpoints

ifconfig gre0 create tunnel 10.1.1.1 10.2.2.2
ifconfig gre0  # not RUNNING (OK)

# place the gre into the jail, it should be running now

ifconfig gre0 vnet demo
jexec demo ifconfig gre0  # not RUNNING (not OK)

# remove and re-apply the tunnel config

jexec demo ifconfig gre0 -tunnel
jexec demo ifconfig gre0 tunnel 10.1.1.1 10.2.2.2
jexec demo ifconfig gre0  # RUNNING (OK)

-- 
John W. O'Brien
OpenPGP keys:
    0x33C4D64B895DBF3B

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20200504/f0eb8659/attachment.sig>


More information about the freebsd-net mailing list