Repository navigation
Commit 4019286
mvs
Fix the race between if_detach() and rtm_output().
When the dying network interface descriptor has if_get(9) obtained
reference owned by foreign thread, the if_detach() thread will sleep
just after it removed this interface from the interface index map.
The data related to this interface is still in routing table, so
if_get(9) called by concurrent rtm_output() thread will return NULL and
the following "ifp != NULL" assertion will be triggered.
So remove the "ifp != NULL" assertions from rtm_output() and try to grab
`ifp' as early as possible then hold it until we finish the work. In the
case we won the race and we have `ifp' non NULL, concurrent if_detach()
thread will wait us. In the case we lost we just return ESRCH.
The problem reported by danj@.
Diff tested by danj@.
ok mpi@1 parent d782ea5 commit 4019286
1 file changed
Lines changed: 27 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | | - | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
938 | 946 | | |
| 947 | + | |
939 | 948 | | |
940 | 949 | | |
941 | 950 | | |
| |||
970 | 979 | | |
971 | 980 | | |
972 | 981 | | |
973 | | - | |
974 | 982 | | |
975 | | - | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
976 | 989 | | |
977 | 990 | | |
978 | 991 | | |
| |||
986 | 999 | | |
987 | 1000 | | |
988 | 1001 | | |
989 | | - | |
990 | 1002 | | |
991 | 1003 | | |
992 | 1004 | | |
| |||
995 | 1007 | | |
996 | 1008 | | |
997 | 1009 | | |
998 | | - | |
999 | 1010 | | |
1000 | 1011 | | |
1001 | 1012 | | |
| |||
1006 | 1017 | | |
1007 | 1018 | | |
1008 | 1019 | | |
1009 | | - | |
1010 | 1020 | | |
1011 | 1021 | | |
1012 | 1022 | | |
| |||
1021 | 1031 | | |
1022 | 1032 | | |
1023 | 1033 | | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1024 | 1043 | | |
1025 | 1044 | | |
1026 | 1045 | | |
| |||
1083 | 1102 | | |
1084 | 1103 | | |
1085 | 1104 | | |
1086 | | - | |
1087 | | - | |
1088 | 1105 | | |
1089 | 1106 | | |
1090 | | - | |
1091 | 1107 | | |
1092 | 1108 | | |
1093 | 1109 | | |
| |||
1152 | 1168 | | |
1153 | 1169 | | |
1154 | 1170 | | |
1155 | | - | |
1156 | | - | |
1157 | 1171 | | |
1158 | | - | |
1159 | 1172 | | |
1160 | 1173 | | |
1161 | 1174 | | |
| |||
1178 | 1191 | | |
1179 | 1192 | | |
1180 | 1193 | | |
| 1194 | + | |
1181 | 1195 | | |
1182 | 1196 | | |
1183 | 1197 | | |
| |||
0 commit comments