@@ -313,6 +313,13 @@ func translateIngress(ns string, policyName string, targetSelector metav1.LabelS
313313 Chain : util .IptablesAzureIngressPortChain ,
314314 Specs : append ([]string (nil ), targetSelectorIptEntrySpec ... ),
315315 }
316+ if portRule .Protocol != nil {
317+ entry .Specs = append (
318+ entry .Specs ,
319+ util .IptablesProtFlag ,
320+ string (* portRule .Protocol ),
321+ )
322+ }
316323 entry .Specs = append (
317324 entry .Specs ,
318325 util .IptablesModuleFlag ,
@@ -385,6 +392,13 @@ func translateIngress(ns string, policyName string, targetSelector metav1.LabelS
385392 Chain : util .IptablesAzureIngressPortChain ,
386393 Specs : append ([]string (nil ), targetSelectorIptEntrySpec ... ),
387394 }
395+ if portRule .Protocol != nil {
396+ entry .Specs = append (
397+ entry .Specs ,
398+ util .IptablesProtFlag ,
399+ string (* portRule .Protocol ),
400+ )
401+ }
388402 entry .Specs = append (
389403 entry .Specs ,
390404 util .IptablesModuleFlag ,
@@ -616,6 +630,13 @@ func translateIngress(ns string, policyName string, targetSelector metav1.LabelS
616630 Chain : util .IptablesAzureIngressPortChain ,
617631 Specs : append ([]string (nil ), targetSelectorIptEntrySpec ... ),
618632 }
633+ if portRule .Protocol != nil {
634+ entry .Specs = append (
635+ entry .Specs ,
636+ util .IptablesProtFlag ,
637+ string (* portRule .Protocol ),
638+ )
639+ }
619640 entry .Specs = append (
620641 entry .Specs ,
621642 iptPartialPodSpec ... ,
@@ -728,6 +749,13 @@ func translateIngress(ns string, policyName string, targetSelector metav1.LabelS
728749 Chain : util .IptablesAzureIngressPortChain ,
729750 Specs : append ([]string (nil ), iptPartialNsSpec ... ),
730751 }
752+ if portRule .Protocol != nil {
753+ entry .Specs = append (
754+ entry .Specs ,
755+ util .IptablesProtFlag ,
756+ string (* portRule .Protocol ),
757+ )
758+ }
731759 entry .Specs = append (
732760 entry .Specs ,
733761 iptPartialPodSpec ... ,
@@ -942,6 +970,13 @@ func translateEgress(ns string, policyName string, targetSelector metav1.LabelSe
942970 Chain : util .IptablesAzureEgressPortChain ,
943971 Specs : append ([]string (nil ), targetSelectorIptEntrySpec ... ),
944972 }
973+ if portRule .Protocol != nil {
974+ entry .Specs = append (
975+ entry .Specs ,
976+ util .IptablesProtFlag ,
977+ string (* portRule .Protocol ),
978+ )
979+ }
945980 entry .Specs = append (
946981 entry .Specs ,
947982 util .IptablesModuleFlag ,
@@ -1014,6 +1049,13 @@ func translateEgress(ns string, policyName string, targetSelector metav1.LabelSe
10141049 Chain : util .IptablesAzureEgressPortChain ,
10151050 Specs : append ([]string (nil ), targetSelectorIptEntrySpec ... ),
10161051 }
1052+ if portRule .Protocol != nil {
1053+ entry .Specs = append (
1054+ entry .Specs ,
1055+ util .IptablesProtFlag ,
1056+ string (* portRule .Protocol ),
1057+ )
1058+ }
10171059 entry .Specs = append (
10181060 entry .Specs ,
10191061 util .IptablesModuleFlag ,
@@ -1254,6 +1296,13 @@ func translateEgress(ns string, policyName string, targetSelector metav1.LabelSe
12541296 entry .Specs ,
12551297 targetSelectorIptEntrySpec ... ,
12561298 )
1299+ if portRule .Protocol != nil {
1300+ entry .Specs = append (
1301+ entry .Specs ,
1302+ util .IptablesProtFlag ,
1303+ string (* portRule .Protocol ),
1304+ )
1305+ }
12571306 entry .Specs = append (
12581307 entry .Specs ,
12591308 util .IptablesModuleFlag ,
@@ -1371,6 +1420,13 @@ func translateEgress(ns string, policyName string, targetSelector metav1.LabelSe
13711420 entry .Specs ,
13721421 iptPartialPodSpec ... ,
13731422 )
1423+ if portRule .Protocol != nil {
1424+ entry .Specs = append (
1425+ entry .Specs ,
1426+ util .IptablesProtFlag ,
1427+ string (* portRule .Protocol ),
1428+ )
1429+ }
13741430 entry .Specs = append (
13751431 entry .Specs ,
13761432 util .IptablesModuleFlag ,
0 commit comments