Do not initialize route metrics in import_control hook

During route export, the receiving protocol often initialized route
metrics to default value in its import_control hook before export filter
was executed. This is inconsistent with the expectation that an export
filter would process the same route as one in the routing table and it
breaks setting these metrics before (e.g. for static routes directly in
static protocol).

The patch removes the initialization of route metrics in import_control
hook, the default values are already handled in rt_notify hook called
after export filters.

The patch also changed the behavior of OSPF to keep metrics when a route
is reannounced between OSPF instances (to be consistent with other
protocols) and the behavior when both ospf_metric1 and ospf_metric2
are specified (to have more expected behavior).
32 jobs for <span class="ref-name">int-new</span> in 8 minutes and 12 seconds (queued for 10 seconds)
Status Job ID Name Coverage
  Image
passed #139285
dind allowed to fail
docker_centos-6-amd64

00:00:21

passed #139286
dind allowed to fail
docker_centos-7-amd64

00:00:23

passed #139275
dind allowed to fail
docker_debian-7-amd64

00:00:46

passed #139279
dind allowed to fail
docker_debian-7-i386

00:00:45

passed #139276
dind allowed to fail
docker_debian-8-amd64

00:00:45

passed #139280
dind allowed to fail
docker_debian-8-i386

00:00:30

passed #139277
dind allowed to fail
docker_debian-9-amd64

00:00:45

passed #139281
dind allowed to fail
docker_debian-9-i386

00:00:28

passed #139278
dind allowed to fail
docker_debian-testing-amd64

00:00:45

passed #139282
dind allowed to fail
docker_debian-testing-i386

00:00:26

passed #139283
dind allowed to fail
docker_fedora-25-amd64

00:00:28

passed #139284
dind allowed to fail
docker_fedora-26-amd64

00:00:28

passed #139287
dind allowed to fail
docker_opensuse-42_3-amd64

00:00:26

passed #139288
dind allowed to fail
docker_ubuntu-14_04-amd64

00:00:24

passed #139289
dind allowed to fail
docker_ubuntu-16_04-amd64

00:00:25

 
  Build
passed #139296
docker linux amd64
build-centos-6-amd64

00:01:09

passed #139297
docker linux amd64
build-centos-7-amd64

00:01:07

passed #139290
docker linux amd64
build-debian-7-amd64

00:01:10

passed #139301
docker linux amd64
build-debian-7-i386

00:01:10

passed #139291
docker linux amd64
build-debian-8-amd64

00:00:57

passed #139302
docker linux amd64
build-debian-8-i386

00:00:57

passed #139292
docker linux amd64
build-debian-9-amd64

00:01:11

passed #139303
docker linux amd64
build-debian-9-i386

00:01:13

passed #139293
docker linux amd64
build-debian-testing-amd64

00:01:16

passed #139304
docker linux amd64
build-debian-testing-i386

00:01:00

passed #139294
docker linux amd64
build-fedora-25-amd64

00:01:11

passed #139295
docker linux amd64
build-fedora-26-amd64

00:00:58

passed #139305
freebsd amd64
build-freebsd-11-amd64

00:06:10

passed #139306
freebsd i386
build-freebsd-11-i386

00:06:19

passed #139298
docker linux amd64
build-opensuse-42_3-amd64

00:01:10

passed #139299
docker linux amd64
build-ubuntu-14_04-amd64

00:01:18

passed #139300
docker linux amd64
build-ubuntu-16_04-amd64

00:01:06