MCPcopy Create free account
hub / github.com/F-Stack/f-stack / del_mfc

Function del_mfc

freebsd/netinet/ip_mroute.c:1154–1187  ·  view source on GitHub ↗

* Delete an mfc entry */

Source from the content-addressed store, hash-verified

1152 * Delete an mfc entry
1153 */
1154static int
1155del_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.

Callers 1

X_ip_mrouter_setFunction · 0.85

Calls 3

mfc_findFunction · 0.85
free_bw_listFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected