* Delete an mfc entry */
| 1152 | * Delete an mfc entry |
| 1153 | */ |
| 1154 | static int |
| 1155 | del_mfc(struct mfcctl2 *mfccp) |
| 1156 | { |
| 1157 | struct in_addr origin; |
| 1158 | struct in_addr mcastgrp; |
| 1159 | struct mfc *rt; |
| 1160 | |
| 1161 | origin = mfccp->mfcc_origin; |
| 1162 | mcastgrp = mfccp->mfcc_mcastgrp; |
| 1163 | |
| 1164 | CTR3(KTR_IPMF, "%s: delete mfc orig 0x%08x group %lx", __func__, |
| 1165 | ntohl(origin.s_addr), (u_long)ntohl(mcastgrp.s_addr)); |
| 1166 | |
| 1167 | MFC_LOCK(); |
| 1168 | |
| 1169 | rt = mfc_find(&origin, &mcastgrp); |
| 1170 | if (rt == NULL) { |
| 1171 | MFC_UNLOCK(); |
| 1172 | return EADDRNOTAVAIL; |
| 1173 | } |
| 1174 | |
| 1175 | /* |
| 1176 | * free the bw_meter entries |
| 1177 | */ |
| 1178 | free_bw_list(rt->mfc_bw_meter); |
| 1179 | rt->mfc_bw_meter = NULL; |
| 1180 | |
| 1181 | LIST_REMOVE(rt, mfc_hash); |
| 1182 | free(rt, M_MRTABLE); |
| 1183 | |
| 1184 | MFC_UNLOCK(); |
| 1185 | |
| 1186 | return (0); |
| 1187 | } |
| 1188 | |
| 1189 | /* |
| 1190 | * Send a message to the routing daemon on the multicast routing socket. |
no test coverage detected