BUG/MEDIUM: counters: ensure that src_{inc,clr}_gpc0 creates a missing entry

During 1.5-dev20 there was some code refactoring to make the src_* fetch
function use the same code as sc_*. Unfortunately this introduced a
regression where src_* doesn't create an entry anymore if it does not
exist in the table. The reason is that smp_fetch_sc_stkctr() only calls
stktable_lookup_key() while src_inc_*/src_clr_* used to make use of
stktable_update_key() which additionally create the entry if it does
not exist.

There's no point modifying the common function for these two exceptions,
so instead we now have a function dedicated to the creation of this entry
for src_* only. It is called when the entry didn't exist, so that requires
minimal modifications to existing code.

Thanks to Thierry Fournier for helping diagnose the issue.

This fix must be backported to 1.5.
(cherry picked from commit 0f4eadd4830279f5ee83aa545728fb750f5c8185)

[Note: the backport to 1.5 significantly differs from the version in 1.6
 since we need to use the table's type and to retrieve the source address
 directly from the connection. At least it matches the way other src_*
 fetch functions work, and it's been verified to work fine]
1 file changed