@@ -489,6 +489,42 @@ def test_filter_ipv4_ingress_protocol_encap_by_num(self):
489489 egress = None
490490 self ._test_prepare_port_filter (rule , ingress , egress )
491491
492+ def test_filter_ipv4_ingress_protocol_ipip (self ):
493+ # 'ipip' via the API uses 'ipencap' to match what iptables-save
494+ # uses, which is IP-ENCAP/'4' from /etc/protocols (see bug #2054324)
495+ rule = {'ethertype' : 'IPv4' ,
496+ 'direction' : 'ingress' ,
497+ 'protocol' : 'ipip' }
498+ ingress = mock .call .add_rule ('ifake_dev' ,
499+ '-p ipencap -j RETURN' ,
500+ top = False , comment = None )
501+ egress = None
502+ self ._test_prepare_port_filter (rule , ingress , egress )
503+
504+ def test_filter_ipv4_ingress_protocol_ipip_by_num (self ):
505+ # '4' via the API uses 'ipencap' to match what iptables-save
506+ # uses, which is IP-ENCAP/'4' from /etc/protocols (see bug #2054324)
507+ rule = {'ethertype' : 'IPv4' ,
508+ 'direction' : 'ingress' ,
509+ 'protocol' : '4' }
510+ ingress = mock .call .add_rule ('ifake_dev' ,
511+ '-p ipencap -j RETURN' ,
512+ top = False , comment = None )
513+ egress = None
514+ self ._test_prepare_port_filter (rule , ingress , egress )
515+
516+ def test_filter_ipv4_ingress_protocol_ipencap_by_num (self ):
517+ # '94' via the API uses 'ipip' to match what iptables-save
518+ # uses, which is IPIP/'94' from /etc/protocols (see bug #2054324)
519+ rule = {'ethertype' : 'IPv4' ,
520+ 'direction' : 'ingress' ,
521+ 'protocol' : '94' }
522+ ingress = mock .call .add_rule ('ifake_dev' ,
523+ '-p ipip -j RETURN' ,
524+ top = False , comment = None )
525+ egress = None
526+ self ._test_prepare_port_filter (rule , ingress , egress )
527+
492528 def test_filter_ipv4_ingress_protocol_999_local (self ):
493529 # There is no protocol 999, so let's return a mapping
494530 # that says there is and make sure the rule is created
0 commit comments