@@ -613,7 +613,7 @@ func TestRuleString(t *testing.T) {
613613 s string
614614 }{
615615 "empty rule" : {
616- s : "ip rule 0: from all to all table 0" ,
616+ s : "ip rule 0: from all to all table 0 " ,
617617 },
618618 "rule with src and dst equivalent to <nil>" : {
619619 r : Rule {
@@ -622,7 +622,7 @@ func TestRuleString(t *testing.T) {
622622 Dst : & net.IPNet {IP : net .IPv4 (20 , 0 , 0 , 0 )},
623623 Table : 99 ,
624624 },
625- s : "ip rule 100: from all to all table 99" ,
625+ s : "ip rule 100: from all to all table 99 " ,
626626 },
627627 "rule with src and dst" : {
628628 r : Rule {
@@ -631,7 +631,14 @@ func TestRuleString(t *testing.T) {
631631 Dst : & net.IPNet {IP : net .IPv4 (20 , 0 , 0 , 0 ), Mask : net .IPv4Mask (255 , 255 , 255 , 0 )},
632632 Table : 99 ,
633633 },
634- s : "ip rule 100: from 10.0.0.0/24 to 20.0.0.0/24 table 99" ,
634+ s : "ip rule 100: from 10.0.0.0/24 to 20.0.0.0/24 table 99 " ,
635+ },
636+ "rule with type" : {
637+ r : Rule {
638+ Priority : 101 ,
639+ Type : unix .RTN_UNREACHABLE ,
640+ },
641+ s : "ip rule 101: from all to all table 0 unreachable" ,
635642 },
636643 }
637644
@@ -671,6 +678,7 @@ func ruleEquals(a, b Rule) bool {
671678 a .IifName == b .IifName &&
672679 a .Invert == b .Invert &&
673680 a .Tos == b .Tos &&
681+ a .Type == b .Type &&
674682 a .IPProto == b .IPProto &&
675683 a .Protocol == b .Protocol &&
676684 a .Mark == b .Mark &&
0 commit comments